mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
Adapt theme to be compatible with hugoBasicExample
_default/{archives,list}.html utilize .site.Params.mainSections This flexible option let's users decide what content pages they want to display in the archive and on the homepage. By default, Hugo adds content types with the most content files as a good heuristic. Can be overwritten at any time in the config file. Signed-off-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
This commit is contained in:
parent
75d5acc15d
commit
ab14f2f275
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
<div class="archive">
|
<div class="archive">
|
||||||
<header class="page-header"><h1>{{ .Title }}</h1></header>
|
<header class="page-header"><h1>{{ .Title }}</h1></header>
|
||||||
|
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||||
{{ range .Site.RegularPages.GroupByPublishDate "2006" }}
|
{{ range $pages.GroupByPublishDate "2006" }}
|
||||||
{{ if ne .Key "0001" }}
|
{{ if ne .Key "0001" }}
|
||||||
<div class="archive-year">
|
<div class="archive-year">
|
||||||
<h2 class="archive-year-header">{{ replace .Key "0001" "" }}</h2>
|
<h2 class="archive-year-header">{{ replace .Key "0001" "" }}</h2>
|
||||||
|
@ -4,20 +4,20 @@
|
|||||||
{{- partial "indexProfile.html" . }}
|
{{- partial "indexProfile.html" . }}
|
||||||
{{else}} {{/* if not profileMode */}}
|
{{else}} {{/* if not profileMode */}}
|
||||||
|
|
||||||
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
|
{{- if not .IsHome | and .Title }}
|
||||||
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
|
|
||||||
|
|
||||||
{{ $PageContext := . }}
|
|
||||||
{{ if .IsHome }}
|
|
||||||
{{ $PageContext = .Site }}
|
|
||||||
{{else}}
|
|
||||||
{{- if .Title }}
|
|
||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
</header>
|
</header>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
|
|
||||||
|
{{ $pages := .RegularPages }}
|
||||||
|
|
||||||
|
{{ if .IsHome }}
|
||||||
|
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{ $paginator := .Paginate $pages }}
|
||||||
|
|
||||||
{{- range $index, $page := $paginator.Pages }}
|
{{- range $index, $page := $paginator.Pages }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user