hexo-theme-stellar/layout/_plugins/tianli_gpt.ejs

15 lines
559 B
Plaintext

<%
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) => {
new ChucklePostAI(Object.assign({
el: 'article.content',
css: `/css/_plugins/tianli_gpt`
}, JSON.parse(`<%- JSON.stringify(theme.plugins.tianli_gpt) %>`)))
});
</script>
<% } %>