From 7d08530af885dd51e4d68a30b870715029cf1de7 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Wed, 7 Feb 2024 17:39:21 +0800 Subject: [PATCH] [opt] indent --- scripts/tags/lib/timeline.js | 2 +- source/css/_layout/md.styl | 10 +++++++++- source/js/plugins/fcircle.js | 2 +- source/js/plugins/memos.js | 2 +- source/js/plugins/timeline.js | 2 +- source/js/plugins/weibo.js | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/tags/lib/timeline.js b/scripts/tags/lib/timeline.js index ca05df5..e9a182a 100644 --- a/scripts/tags/lib/timeline.js +++ b/scripts/tags/lib/timeline.js @@ -18,7 +18,7 @@ function layoutNodeTitle(ctx, content) { var el = '' el += '
' if (content && content.length > 0) { - el += ctx.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('') + el += content } el += '
' return el diff --git a/source/css/_layout/md.styl b/source/css/_layout/md.styl index faf5da2..4109a9b 100644 --- a/source/css/_layout/md.styl +++ b/source/css/_layout/md.styl @@ -20,9 +20,12 @@ overflow: hidden .l_body[text-indent] .md-text.content - >p + // 应用缩进效果 + p:not([class]) text-indent: 'calc(%s * 2)' % var(--fsp) text-align: justify + a + text-indent: 0 ol,ul margin-left: 0.5em h1,h2,h3,h4,h5,h6 @@ -31,6 +34,11 @@ display: none h2 margin: 2em 0 1.5em + // 取消缩进效果 + blockquote, .poetry, .okr, .timeline, li + p:not([class]) + text-indent: 0 + text-align: convert(hexo-config('style.text-align')) .md-text ul:not(:last-child), diff --git a/source/js/plugins/fcircle.js b/source/js/plugins/fcircle.js index 4021956..4ad6505 100644 --- a/source/js/plugins/fcircle.js +++ b/source/js/plugins/fcircle.js @@ -59,7 +59,7 @@ const FCircle = { cell += ''; cell += '' + item.author + ''; cell += ''; - cell += '

' + item.created + '

'; + cell += '' + item.created + ''; cell += ''; cell += ''; cell += item.title; diff --git a/source/js/plugins/memos.js b/source/js/plugins/memos.js index 397a0c8..e96517f 100644 --- a/source/js/plugins/memos.js +++ b/source/js/plugins/memos.js @@ -77,7 +77,7 @@ const MemosJS = { cell += '' + item.creatorName + ''; cell += ''; } - cell += '

' + date.toLocaleString() + '

'; + cell += '' + date.toLocaleString() + ''; cell += ''; cell += '
'; cell += marked.parse(item.content || ''); diff --git a/source/js/plugins/timeline.js b/source/js/plugins/timeline.js index 5ce1972..3b1ac1d 100644 --- a/source/js/plugins/timeline.js +++ b/source/js/plugins/timeline.js @@ -84,7 +84,7 @@ const StellarTimeline = { cell += ''; } let date = new Date(item.created_at); - cell += '

' + date.toLocaleString() + '

'; + cell += '' + date.toLocaleString() + ''; cell += '
'; cell += '
'; if (!hide.includes('title')) { diff --git a/source/js/plugins/weibo.js b/source/js/plugins/weibo.js index 69c872b..28d870e 100644 --- a/source/js/plugins/weibo.js +++ b/source/js/plugins/weibo.js @@ -59,7 +59,7 @@ const weibojs = { cell += ''; cell += '' + data.user.nick_name + ''; cell += '
'; - cell += '

' + item.created_at + '

'; + cell += '' + item.created_at + ''; cell += ''; cell += '
'; cell += '';