15 lines
564 B
Plaintext
15 lines
564 B
Plaintext
<%
|
|
const { field } = theme.plugins.tianli_gpt;
|
|
const matchesField = field === 'all' || field === page.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) => {
|
|
new ChucklePostAI(Object.assign({
|
|
el: 'article.content',
|
|
css: `/css/_plugins/tianli_gpt`
|
|
}, JSON.parse(`<%- JSON.stringify(theme.plugins.tianli_gpt) %>`)))
|
|
});
|
|
</script>
|
|
<% } %>
|