Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc54cecf0a | ||
|
|
deceb17144 | ||
|
|
dc0d105e7c |
@@ -5,7 +5,8 @@ date: {{ .Date }}
|
||||
image:
|
||||
math:
|
||||
license:
|
||||
hidden: false
|
||||
comments: true
|
||||
draft: true
|
||||
build:
|
||||
list: always # Change to "never" to hide the page from the list
|
||||
---
|
||||
@@ -2,6 +2,11 @@ mainSections = ["post"]
|
||||
featuredImageField = "image"
|
||||
rssFullContent = true
|
||||
|
||||
# Accepted values: "default", "lastmod"
|
||||
# default = see https://gohugo.io/quick-reference/glossary/#default-sort-order
|
||||
# lastmod = sort by last modified date, in descending order
|
||||
SortBy = "default"
|
||||
|
||||
[footer]
|
||||
since = 2026
|
||||
customText = ""
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }}
|
||||
{{ $related := (.Site.RegularPages.Related .) | first 5 }}
|
||||
{{ with $related }}
|
||||
<aside class="related-content--wrapper">
|
||||
<h2 class="section-title">{{ T "article.relatedContent" }}</h2>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{{- $pages := .Pages -}}
|
||||
|
||||
{{- if eq .Context.Site.Params.SortBy "lastmod" -}}
|
||||
{{- $pages = $pages.ByLastmod.Reverse -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $pages -}}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- $pages := .Pages -}}
|
||||
|
||||
{{- if .IsHome -}}
|
||||
{{- $pages = where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
|
||||
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}}
|
||||
{{- $subsections := .Sections -}}
|
||||
{{- $pages = .Pages | complement $subsections -}}
|
||||
|
||||
{{- if eq (len $pages) 0 -}}
|
||||
{{- $pages = $subsections -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $pages := partial "helper/pages-sort.html" (dict "Pages" $pages "Context" .) -}}
|
||||
|
||||
{{- return $pages -}}
|
||||
@@ -1,28 +1,8 @@
|
||||
{{- $pages := slice -}}
|
||||
{{- $hasPages := false -}}
|
||||
{{- $result := slice -}}
|
||||
|
||||
{{- if .IsHome -}}
|
||||
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
||||
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
||||
{{- $hasPages = true -}}
|
||||
{{- else if eq .Kind "term" -}}
|
||||
{{ $pages = where .Pages "Params.hidden" "!=" true }}
|
||||
{{- $hasPages = true -}}
|
||||
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
|
||||
{{ $subsections := .Sections }}
|
||||
{{ $pages = .Pages | complement $subsections }}
|
||||
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
||||
|
||||
{{- if eq (len $pages) 0 -}}
|
||||
{{/* See complete logic in list.html */}}
|
||||
{{- $pages = $subsections -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $hasPages = true -}}
|
||||
{{- if or .IsHome (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}}
|
||||
{{- $pages := partial "helper/pages.html" . -}}
|
||||
{{- $result = .Paginate $pages -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $hasPages -}}
|
||||
{{ $pages = .Paginate $pages }}
|
||||
{{- end -}}
|
||||
|
||||
{{ return $pages }}
|
||||
{{- return $result -}}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{{ with .Site.Params.sidebar.avatar }}
|
||||
{{- $avatar := partial "helper/image" (dict "Image" . "Resources" resources) -}}
|
||||
<figure class="site-avatar">
|
||||
<a href="{{ .Site.Home.RelPermalink }}">
|
||||
<a href="{{ $.Site.Home.RelPermalink }}">
|
||||
<img src="{{ $avatar.Permalink }}"
|
||||
width="{{ $avatar.Width }}"
|
||||
height="{{ $avatar.Height }}"
|
||||
|
||||
@@ -9,9 +9,8 @@
|
||||
</div>
|
||||
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
||||
|
||||
{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
|
||||
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||
{{ $archives := $filtered.GroupByDate "2006" }}
|
||||
{{ $pages := partial "helper/pages.html" $context.Site.Home }}
|
||||
{{ $archives := $pages.GroupByDate "2006" }}
|
||||
|
||||
<div class="widget-archive--list">
|
||||
{{ range $index, $item := first (add $limit 1) ($archives) }}
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
{{ end }}
|
||||
</header>
|
||||
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||
{{ $pages := partial "helper/pages.html" .Site.Home }}
|
||||
|
||||
{{ range $filtered.GroupByDate "2006" }}
|
||||
{{ range $pages.GroupByDate "2006" }}
|
||||
{{ $id := lower (replace .Key " " "-") }}
|
||||
<div class="archives-group" id="{{ $id }}">
|
||||
<h2 class="archives-date section-title"><a href="{{ $.RelPermalink }}#{{ $id }}">{{ .Key }}</a></h2>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
{{- else -}}
|
||||
{{- $pages = $pctx.Pages -}}
|
||||
{{- end -}}
|
||||
{{- $pages := where $pages "Params.hidden" "!=" true -}}
|
||||
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
{{- $pages = $pages | first $limit -}}
|
||||
+2
-6
@@ -29,14 +29,10 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{- $pages := partial "helper/pages.html" . -}}
|
||||
{{- $subsections := .Sections -}}
|
||||
{{- $pages := .Pages | complement $subsections -}}
|
||||
{{- $pages = where $pages "Params.hidden" "!=" true -}}
|
||||
|
||||
{{- if eq (len $pages) 0 -}}
|
||||
{{/* If there are no normal pages, display subsections in list style, with pagination */}}
|
||||
{{/* This happens with taxonomies like categories or tags */}}
|
||||
{{- $pages = $subsections -}}
|
||||
{{- if and (eq (len $pages) (len $subsections)) (eq $pages $subsections) -}}
|
||||
{{- $subsections = slice -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
|
||||
{{- $filtered := where $pages "Params.hidden" "!=" true -}}
|
||||
|
||||
{{- $pages := partial "helper/pages.html" .Site.Home -}}
|
||||
{{- $result := slice -}}
|
||||
|
||||
{{- range $filtered -}}
|
||||
{{- range $pages -}}
|
||||
{{- $data := dict "title" .Title "date" .Date "permalink" .RelPermalink "content" (.Plain) -}}
|
||||
|
||||
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}}
|
||||
|
||||
Reference in New Issue
Block a user