From 724d23ca5c972c1f18afb126660c168831267ecd Mon Sep 17 00:00:00 2001 From: pan93412 Date: Wed, 2 Mar 2022 14:33:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A0=E5=85=A5=20heti=20=E6=8E=92?= =?UTF-8?q?=E7=89=88=E6=A8=A3=E5=BC=8F=E5=A2=9E=E5=BC=B7=20CSS=20=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8F=B4=20(#64)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 加入 heti 排版樣式增強 CSS 的支援 「赫蹏」是專為中文網頁內容設計的排版樣式增強。 它基於通行的中文排版規範,可為網站的讀者 帶來更好的內容閱讀體驗。 目前只套用在文章和文章卡片的摘要上。 https://sivan.github.io/heti/ * feat(config): 增加 heti 設定項 取用方式:theme.heti (boolean) * refactor: add dns-prefetch for unpkg.com * Update _config.yml Co-authored-by: xaoxuu <16400144+xaoxuu@users.noreply.github.com> --- _config.yml | 9 +++++++++ layout/_partial/head.ejs | 10 ++++++++++ layout/_partial/main/post_list/post_card.ejs | 2 +- layout/post.ejs | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index a647002..8497d2b 100755 --- a/_config.yml +++ b/_config.yml @@ -248,6 +248,15 @@ plugins: enable: true css: https://unpkg.com/swiper@6/swiper-bundle.min.css js: https://unpkg.com/swiper@6/swiper-bundle.min.js + + + # 赫蹏 (Heti) - 专为中文网页内容设计的排版样式增强 + # https://github.com/sivan/heti + heti: + enable: false + css: https://unpkg.com/heti/umd/heti.min.css + js: https://unpkg.com/heti/umd/heti-addon.min.js + style: darkmode: auto # auto / always / false diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 6cbe841..0de8099 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -51,6 +51,7 @@ function og_args() { + @@ -61,6 +62,15 @@ function og_args() { <%- generate_title() %> + <% if (theme.heti) { %> + + + + <% } %> + <% if (theme.open_graph && theme.open_graph.enable) { %> <%- open_graph(og_args()) %> <% } %> diff --git a/layout/_partial/main/post_list/post_card.ejs b/layout/_partial/main/post_list/post_card.ejs index 0f1c01f..a6bbe90 100755 --- a/layout/_partial/main/post_list/post_card.ejs +++ b/layout/_partial/main/post_list/post_card.ejs @@ -40,7 +40,7 @@ function div_default() { el += ''; // 摘要 - el += '
'; + el += '
'; el += '

'; if (post.excerpt) { el += strip_html(post.excerpt); diff --git a/layout/post.ejs b/layout/post.ejs index f65960b..e1ddffd 100755 --- a/layout/post.ejs +++ b/layout/post.ejs @@ -16,7 +16,7 @@ function layoutTitle() { %> <% let post = page; %> <%- partial('_partial/main/navbar/breadcrumb') %> -

<%- scrollreveal() %>'> +
<%- scrollreveal() %>'> <%- layoutTitle() %> <%- post.content %> <%- partial('_partial/main/article/article_footer') %>