fix ai postselector (#362)

* fix ai postselector

* Update tianli_gpt.ejs

---------

Co-authored-by: xaoxuu <16400144+xaoxuu@users.noreply.github.com>
This commit is contained in:
星日语 2024-01-20 02:08:08 +08:00 committed by GitHub
parent 8c22e1f22f
commit f0964f4fc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
<% if (page.layout === 'post' || (page.wiki?.length > 0)) { %> <% if (page.layout === 'post' || (page.wiki?.length > 0)) { %>
<script> <script>
let tianliGPT_postSelector = '.md-text.content.<%= page.layout === "post" ? "post" : "wiki" %>'; let tianliGPT_postSelector = 'article.content';
let tianliGPT_key = '<%= theme.plugins.tianli_gpt.api %>'; let tianliGPT_key = '<%= theme.plugins.tianli_gpt.api %>';
let tianliGPT_typingAnimate = '<%= theme.plugins.tianli_gpt.typingAnimate %>'; let tianliGPT_typingAnimate = '<%= theme.plugins.tianli_gpt.typingAnimate %>';
let tianliGPT_wordLimit = <%= theme.plugins.tianli_gpt.limit %>; let tianliGPT_wordLimit = <%= theme.plugins.tianli_gpt.limit %>;

View File

@ -62,6 +62,9 @@ function layoutDiv() {
if (layout === 'post' || page.wiki) { if (layout === 'post' || page.wiki) {
el += partial('_partial/main/article/read_next') el += partial('_partial/main/article/read_next')
} }
if (isUsingTianliGPT) {
el += partial('_partial/plugins/ai/tianli_gpt')
}
if (layout === 'post') { if (layout === 'post') {
el += partial('_partial/main/article/related_posts') el += partial('_partial/main/article/related_posts')
} }