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

15 lines
564 B
Plaintext
Raw Permalink Normal View History

2024-04-10 10:26:03 +08:00
<%
const { field } = theme.plugins.tianli_gpt;
2024-06-12 21:59:21 +08:00
const matchesField = field === 'all' || field === page.layout || (field === 'wiki' && page.wiki) || (field === 'topic' && page.topic);
2024-04-10 10:26:03 +08:00
if (matchesField) { %>
2024-02-18 12:31:36 +08:00
<script defer src="<%- theme.plugins.tianli_gpt?.js %>"></script>
<script defer>
window.addEventListener('DOMContentLoaded', (event) => {
new ChucklePostAI(Object.assign({
el: 'article.content',
2024-02-18 12:31:36 +08:00
css: `/css/_plugins/tianli_gpt`
}, JSON.parse(`<%- JSON.stringify(theme.plugins.tianli_gpt) %>`)))
});
</script>
2024-04-10 10:26:03 +08:00
<% } %>