Hugo内容

This commit is contained in:
2026-02-27 11:41:19 +08:00
parent 544c97c013
commit 4f7f72b65f
37 changed files with 795 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="{{ $.Site.LanguageCode }}">
{{- partial "head.html" . -}}
<body a="{{ $.Site.Params.theme_config.appearance | default "auto" }}">
<main class="page-content" aria-label="Content">
<div class="w">
<div class="post-meta">
{{ partial "back_link.html" .}}
<p>
<time datetime="{{ .Date }}">
{{ .Date | time.Format site.Params.theme_config.date_format }}
</time>
</p>
</div>
{{- block "main" . }}{{- end }}
</div>
</main>
</body>
{{- if .Params.custom_js -}}
{{- range .Params.custom_js -}}
{{ $js := resources.Get (print "js/" . ".js") }}
<script type="text/javascript" src="{{ $js.RelPermalink }}"></script>
{{- end -}}
{{- end -}}
</html>

View File

@@ -0,0 +1,21 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
<!-- divide post list by year -->
{{ if .Site.Params.theme_config.isListGroupByDate }}
{{ range .Pages.GroupByDate "2006 Year" }}
<p>{{ .Key }}</p>
<ul>
{{ range .Pages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ else }}
{{ partial "post_list.html" (dict "context" . "section" .Section)}}
{{ end }}
{{ end }}

View File

@@ -0,0 +1,14 @@
{{ define "main" }}
<article>
<h1>{{ .Title }}</h1>
{{ if .Params.toc }}
<aside {{ if .Params.tocBorder }} class="toc" {{ end }}>
{{ .TableOfContents }}
</aside>
{{ end }}
{{ .Content }}
</article>
{{ end }}