From c40ac638b5988e24c22cf3052289822e0d1c2deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E6=97=A5=E8=AF=AD?= Date: Wed, 10 Apr 2024 10:26:03 +0800 Subject: [PATCH] [fix] tianli_gpt layout (#429) --- layout/_plugins/tianli_gpt.ejs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layout/_plugins/tianli_gpt.ejs b/layout/_plugins/tianli_gpt.ejs index 866dd6f..28051d8 100644 --- a/layout/_plugins/tianli_gpt.ejs +++ b/layout/_plugins/tianli_gpt.ejs @@ -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) { %> -<% } %> \ No newline at end of file +<% } %>