summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/css/components/_post.scss21
-rw-r--r--layouts/posts/single.html15
2 files changed, 32 insertions, 4 deletions
diff --git a/assets/css/components/_post.scss b/assets/css/components/_post.scss
index 05e29e08..4ff79bb6 100644
--- a/assets/css/components/_post.scss
+++ b/assets/css/components/_post.scss
@@ -120,3 +120,24 @@
}
}
}
+
+/* endnotes */
+
+#post-endnotes {
+ color: var(--secondary-text-color);
+ font-size: 1rem;
+ h3 {
+ font-size: 1rem;
+ width: fit-content;
+ margin: 0;
+ }
+ ul {
+ li {
+ list-style-type: '→';
+ padding-left: 1rem;
+ &::marker {
+ color: var(--secondary-text-color);
+ }
+ }
+ }
+}
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index 00517df4..53182ef7 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -35,13 +35,20 @@
</header>
<!-- Post Content -->
- <div id="post-content" class="post-content markdown-body"
+ <div class="post-content markdown-body"
style="view-transition-name: post-content-{{ .File.UniqueID }}">
{{ if .Params.toc }}{{ partial "components/toc" . }}{{ end }}
{{ .Site.Params.postHeaderContent | safeHTML }}
- {{ .Content }}
- {{ if eq .Site.Language.Lang "zh" }}
- <p style="font-size: 0.9rem">如果你觉得文章对你有帮助,可以考虑<a href="/sponsor">赞助作者</a></p>
+ <div id="post-content">{{ .Content }}</div>
+ {{ if .Params.endnotes }}
+ <hr>
+ <div id="post-endnotes">
+ <ul>
+ {{ range .Params.endnotes }}
+ <li>{{ . | markdownify }}</li>
+ {{ end }}
+ </ul>
+ </div>
{{ end }}
</div>