mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 00:52:43 +00:00
Issue #697: Add setting order_sections_by_date
This commit is contained in:
parent
33fbda0e9d
commit
4daa6044e6
@ -36,6 +36,9 @@ enableRobotsTXT = true
|
||||
background_color_class = "bg-black"
|
||||
recent_posts_number = 3
|
||||
|
||||
# Sort sections by date (oldest first)
|
||||
#order_sections_by_date = true
|
||||
|
||||
[[params.ananke_socials]]
|
||||
name = "twitter"
|
||||
url = "https://twitter.com/GoHugoIO"
|
||||
|
@ -11,6 +11,11 @@
|
||||
{{ $section_name := . }}
|
||||
{{/* Create a variable with that section to use in multiple places. */}}
|
||||
{{ $section := where $.Site.RegularPages "Section" "in" $section_name }}
|
||||
|
||||
{{ if $.Site.Params.order_sections_by_date | default false }}
|
||||
{{ $section = $section.ByDate }}
|
||||
{{ end }}
|
||||
|
||||
{{ $section_count := len $section }}
|
||||
{{ if ge $section_count 1 }}
|
||||
<div class="pa3 pa4-ns w-100 w-70-ns center">
|
||||
|
Loading…
x
Reference in New Issue
Block a user