[fix] tianli_gpt layout (#429)
This commit is contained in:
parent
511834d6c9
commit
c40ac638b5
|
@ -1,4 +1,7 @@
|
|||
<% if (['all', page.layout].includes(theme.plugins.tianli_gpt.field)) { %>
|
||||
<%
|
||||
const { field } = theme.plugins.tianli_gpt;
|
||||
const matchesField = field === 'all' || field === layout || (field === 'wiki' && page.wiki) || (field === 'topic' && page.topic);
|
||||
if (matchesField) { %>
|
||||
<script defer src="<%- theme.plugins.tianli_gpt?.js %>"></script>
|
||||
<script defer>
|
||||
window.addEventListener('DOMContentLoaded', (event) => {
|
||||
|
@ -8,4 +11,4 @@
|
|||
}, JSON.parse(`<%- JSON.stringify(theme.plugins.tianli_gpt) %>`)))
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
|
Loading…
Reference in New Issue