diff options
| author | rtk0c <[email protected]> | 2025-10-13 11:09:38 -0700 |
|---|---|---|
| committer | rtk0c <[email protected]> | 2025-10-13 11:09:38 -0700 |
| commit | 5eecca6277dbf6ae74d8ae596542ba05d31b09fd (patch) | |
| tree | a5e2a36e97a5cf8f974d7cc351ed5376ea7e3d58 | |
| parent | 552bcdc848c8a272fc834f8ab9560f203037bbf7 (diff) | |
Make theme respect _index.md
PaperMod's default is so fucking atrocious...
why, like why reinvent a homepage system in the config file???
| -rw-r--r-- | content/_index.md | 5 | ||||
| -rw-r--r-- | content/_index.zh.md | 7 | ||||
| -rw-r--r-- | hugo.yaml | 10 | ||||
| -rw-r--r-- | themes/PaperMod/layouts/_default/list.html | 27 | ||||
| -rw-r--r-- | themes/PaperMod/layouts/partials/home_info.html | 6 |
5 files changed, 24 insertions, 31 deletions
diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..2c86252 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,5 @@ +--- +title: "rtk0c's hut" +--- + +Technical findings, life stories, and projects. diff --git a/content/_index.zh.md b/content/_index.zh.md new file mode 100644 index 0000000..7b03a28 --- /dev/null +++ b/content/_index.zh.md @@ -0,0 +1,7 @@ +--- +title: "rtk0c的小窝" +--- + +啦啦啦啦啦啦啦! 若是读得懂英文,也敬请到英文站点参观一下喽! + +关于本站点挂载Cloudflare Pages上进而大陆访问速度有时玄学的问题,主要是因为本人比较懒(反正也没什么人读了啦 @@ -34,10 +34,6 @@ languages: url: /search weight: 10 params: - homeInfoParams: - Title: "rtk0c's hut" - Content: > - Technical findings, life stories, and projects. zh: languageName: "中文 zh_CN" @@ -54,12 +50,6 @@ languages: url: /search weight: 10 params: - homeInfoParams: - Title: "rtk0c的小窝" - Content: > - 啦啦啦啦啦啦啦! - 若是读得懂英文,也敬请到英文站点参观一下喽! - 关于本站点挂载Cloudflare Pages上进而大陆访问速度有时玄学的问题,主要是因为本人比较懒(反正也没什么人读了啦 params: env: development diff --git a/themes/PaperMod/layouts/_default/list.html b/themes/PaperMod/layouts/_default/list.html index 81aea6e..e0d0d40 100644 --- a/themes/PaperMod/layouts/_default/list.html +++ b/themes/PaperMod/layouts/_default/list.html @@ -30,14 +30,6 @@ </header> {{- end }} -{{- if .Content }} -<div class="post-content"> - {{- if not (.Param "disableAnchoredHeadings") }} - {{- partial "anchored_headings.html" .Content -}} - {{- else }}{{ .Content }}{{ end }} -</div> -{{- end }} - {{- $pages := union .RegularPages .Sections }} {{- if .IsHome }} @@ -47,21 +39,22 @@ {{- $paginator := .Paginate $pages }} -{{- if and .IsHome site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} +{{- if and .IsHome (eq $paginator.PageNumber 1) }} {{- partial "home_info.html" . }} {{- end }} +{{- if and (not .IsHome) .Content }} +<div class="post-content"> + {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +</div> +{{- end }} + {{- $term := .Data.Term }} {{- range $index, $page := $paginator.Pages }} -{{- $class := "post-entry" }} - -{{- $user_preferred := or site.Params.disableSpecial1stPost site.Params.homeInfoParams }} -{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} -{{- $class = "first-entry" }} -{{- else if $term }} -{{- $class = "post-entry tag-entry" }} -{{- end }} +{{- $class := "post-entry tag-entry" }} <article class="{{ $class }}"> {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} diff --git a/themes/PaperMod/layouts/partials/home_info.html b/themes/PaperMod/layouts/partials/home_info.html index 199dfb7..3d96145 100644 --- a/themes/PaperMod/layouts/partials/home_info.html +++ b/themes/PaperMod/layouts/partials/home_info.html @@ -1,13 +1,11 @@ -{{- with site.Params.homeInfoParams }} <article class="first-entry home-info"> <header class="entry-header"> <h1>{{ .Title | markdownify }}</h1> </header> <div class="entry-content"> - {{ .Content | markdownify }} + {{ .Content }} </div> <footer class="entry-footer"> - {{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }} + {{ partial "social_icons.html" }} </footer> </article> -{{- end -}} |
