diff options
author | mayx | 2024-07-02 08:25:21 +0000 |
---|---|---|
committer | mayx | 2024-07-02 08:25:21 +0000 |
commit | 934c04aea725394c0e391909c486dc4fc6b0f3a3 (patch) | |
tree | 2a21ee19f8864dad43f442c67770db03f8736a36 | |
parent | 5c7773fb59d59bdb57fc20789ad44a01dff5c73d (diff) |
Update file post.html
-rw-r--r-- | _layouts/post.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/_layouts/post.html b/_layouts/post.html index 12abedd..5fcac86 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -28,7 +28,7 @@ layout: default {% if page.layout != "encrypt" %} <!--[if !IE]> --> <b>AI摘要</b> -<p id="ai-output"></p> +<p id="ai-output">正在生成中……</p> <script> async function sha(str) { const encoder = new TextEncoder(); @@ -40,7 +40,7 @@ layout: default .join(""); // convert bytes to hex string return hashHex; } - var postContent = "文章标题:" + {{ page.content | jsonify }} +",文章内容:" + {{ page.content | strip_html | strip_newlines | jsonify }}; + var postContent = "文章标题:" + {{ page.title | jsonify }} +",文章内容:" + {{ page.content | strip_html | strip_newlines | jsonify }}; var postContentSign = await sha(postContent); var outputContainer = document.getElementById("ai-output"); $.get("https://summary.mayx.eu.org/is_uploaded?id={{ page.url }}&sign=" + postContentSign, function (data) { @@ -52,6 +52,7 @@ layout: default $.post("https://summary.mayx.eu.org/upload_blog?id={{ page.url }}", postContent, function (data) { $.get("https://summary.mayx.eu.org/get_summary?id={{ page.url }}&sign=" + postContentSign); const evSource = new EventSource("https://summary.mayx.eu.org/summary?id={{ page.url }}"); + outputContainer.textContent = ""; evSource.onmessage = (event) => { if (event.data == "[DONE]") { evSource.close(); |