Scope the paragraph indent to article bodies

This commit is contained in:
2026-11-15 18:00:57 +08:00
parent 16d7a9d9ba
commit 4aad34ec58
4 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ AI 在本站的位置是编辑和对手,不是代笔。下面这些是硬规
- 二级标题按篇幅配,大约每 1000 字一个。标题是路标,不是分段工具;一篇三千字的文章用七八个小标题,等于把文章切成碎块,读者跟着标题跳,反而读不下去。
- 大段落靠空行和过渡句切开,不靠加标题。想加小标题的时候先问一句:这里能不能用一句话顶替?能,就写那句话,标题省掉。
- 一节只解决一个问题。小标题要短,能用一个短语说清的,不要写成从句;也不用「之一」「浅谈」「碎碎念」这类虚词占位。
- 一个 `##` 下面通常连着好几段,段与段靠空行分开,不必再往下切 `###`。版面上的层级已经按这个关系配好:段与段之间 0.5rem,正文段落首行缩进两个汉字宽(`text-indent: 2em`,写在 `assets/css/custom.css` 的 `.content > p` 上,引文、边注里的段落不缩进);`###` 上边距 2rem,`##` 上边距 2.5rem。分节靠标题,分段靠空行,两者不混用。首行缩进由样式统一给出,正文里不手打全角空格。
- 一个 `##` 下面通常连着好几段,段与段靠空行分开,不必再往下切 `###`。版面上的层级已经按这个关系配好:段与段之间 0.5rem,正文段落首行缩进两个汉字宽(`text-indent: 2em`,写在 `assets/css/custom.css` 的 `.content.post-body > p` 上;`post-body` 类由 `layouts/blog/single.html` 与 `layouts/_default/single.html` 的正文容器给出,所以列表页导语、引文、边注都不缩进);`###` 上边距 2rem,`##` 上边距 2.5rem。分节靠标题,分段靠空行,两者不混用。首行缩进由样式统一给出,正文里不手打全角空格。
- 长文必须分节;千字以内的短文可以不节,但段落仍要分开。
- 列表只用于并列项。叙述、论证、感受一律写成段落。
- 边注用 `{{< note >}}…{{< /note >}}`,宽屏落在正文左侧页边,窄屏变成虚线框。一条边注只放一件事,一段话写完;比正文还长的「注释」说明它该挪进正文。出处、术语说明、补充数据都走边注。书目用 `{{< note cite >}}`,每行一项,各占一行。
+2 -2
View File
@@ -52,8 +52,8 @@ kbd {
margin-top: 0.5rem;
}
/* 只缩进正文直属段落,引文与边注内不缩进 */
.content > p {
/* 只缩进文章正文直属段落,列表页导语、引文与边注不缩进 */
.content.post-body > p {
text-indent: 2em;
}
+4 -4
View File
@@ -19,7 +19,7 @@
</h1>
<div class="hx:mb-16"></div>
{{ end }}
<div class="content">
<div class="content post-body">
{{ .Content }} {{- with .Params.poet }}
<hr />
<div
@@ -34,7 +34,7 @@
</div>
<script>
(function () {
var all = `{{ . }}`;
var all = `{{ . }}`.replace(/\s+$/, "");
var i = 0,
del = false,
dc = 0,
@@ -83,8 +83,8 @@
if (i < all.length || del) go();
},
del
? 55 + Math.random() * 30
: 70 + Math.random() * 100,
? 40 + Math.random() * 20
: 50 + Math.random() * 60,
);
}
})();
+4 -4
View File
@@ -77,7 +77,7 @@
-}}<span class="hx:mx-1">{{ $author }}</span>
{{- end -}} {{- end -}} {{- end -}}
</div>
<div class="content">
<div class="content post-body">
{{ .Content }} {{- with .Params.poet }}
<hr />
<div
@@ -88,7 +88,7 @@
</div>
<script>
(function () {
var all = `{{ . }}`;
var all = `{{ . }}`.replace(/\s+$/, "");
var i = 0,
del = false,
dc = 0,
@@ -137,8 +137,8 @@
if (i < all.length || del) go();
},
del
? 55 + Math.random() * 30
: 70 + Math.random() * 100,
? 40 + Math.random() * 20
: 50 + Math.random() * 60,
);
}
})();