summary refs log tree commit diff
path: root/_layouts/post.html
diff options
context:
space:
mode:
authormayx2025-04-14 15:45:30 +0000
committermayx2025-04-14 15:45:30 +0000
commit7fe88c21a62c3763498f92994b620070a4a486b4 (patch)
tree5eec0c8ce3658961cb1f9b793c98140197d34877 /_layouts/post.html
parent526c8c35b7c296ae3091c47a05ff6162f1085f80 (diff)
Update 2 files
- /_data/ai-cache.json
- /_layouts/post.html
Diffstat (limited to '_layouts/post.html')
-rw-r--r--_layouts/post.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/_layouts/post.html b/_layouts/post.html
index 22294b3..2207fae 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -28,7 +28,8 @@ layout: default
 {% if page.layout != "encrypt" %}
 <!--[if !IE]> -->
 <b>AI摘要</b>
-<p id="ai-output">正在生成中……</p>
+<p id="ai-output">{% assign ai_cache = site.data.ai-cache[page.url] %}{% if ai_cache %}{{ ai_cache }}{% else %}正在生成中……{% endif %}</p>
+{% unless ai_cache %}
 <script>
   async function sha(str) {
     const encoder = new TextEncoder();
@@ -69,6 +70,7 @@ layout: default
   }
   ai_gen();
 </script>
+{% endunless %}
 <hr />
 <!-- <![endif]-->
 {% endif %}