diff options
| author | verdant <im@verdant.ee> | 2026-07-22 00:03:01 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-22 00:03:01 +0800 |
| commit | a70e68c40246d55678b552d51b8d21cc0e18e3b1 (patch) | |
| tree | 127e9ca69d499c194cb54ec786d4a03329be8e24 /layouts | |
| parent | 8c5828c77437eb9a2958ae011a3a17ad5982cdc8 (diff) | |
| download | blog-a70e68c40246d55678b552d51b8d21cc0e18e3b1.tar.gz blog-a70e68c40246d55678b552d51b8d21cc0e18e3b1.zip | |
Add toc and origin org file
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_default/single.html | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1376214..960a98f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -10,7 +10,7 @@ <div class=meta> <time datetime={{ .Date.Format "2006-01-02T15:04:05Z07:00" }}>{{ .Date.Format "2006-01-02" }}</time> {{ with .Params.categories }} - <span class=cats>[ + <span class=cats style=float:right;>[ {{- range $index, $cat := . -}} {{- if $index }} · {{ end -}}<a href=/categories/{{ $cat | urlize }} />{{ $cat }}</a> {{- end -}} @@ -27,7 +27,13 @@ </div> {{ end }} </header> - {{ .Content }} +{{ if in .TableOfContents "li" }} + <aside class="toc"> + <h2>目錄</h2> + {{ .TableOfContents }} + </aside> +{{ end }} +{{ .Content }} </article> <hr> @@ -35,6 +41,9 @@ <p>条目共享:遵循 <a href=https://creativecommons.org/licenses/by-nc-sa/4.0/ rel="license noopener">CC BY-NC-SA 4.0</a> 协议。 </p> <p>交流通道:向 <a href="mailto:im@verdant.ee?subject=回复《{{ .Title }}》">im@verdant.ee</a> 发送一封 <a - href=https://useplaintext.email />纯文本邮件</a>。</p> + href=https://useplaintext.email />纯文本邮件</a>。</p> +{{ if .Params.org }} +<p><a href=https://git.verdant.ee/personal/blog.git/tree/org/{{ replace .File.LogicalName ".md" ".org" }}>原始 org 文件</a></p> +{{ end }} </footer> {{ end }} |
