diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index a0266c8..fb89f51 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -60,7 +60,6 @@ params: archives: limit: 5 - path: archives tagCloud: limit: 10 @@ -82,7 +81,7 @@ params: colorScheme: # Display toggle toggle: true - + # Available values: auto, light, dark default: auto diff --git a/layouts/partials/widget/archives.html b/layouts/partials/widget/archives.html index 950dbf2..4a92a30 100644 --- a/layouts/partials/widget/archives.html +++ b/layouts/partials/widget/archives.html @@ -1,27 +1,33 @@ -
-
- {{ partial "helper/icon" "infinity" }} -
-

{{ T "widget.archives.title" }}

+{{- $query := first 1 (where .Site.Pages "Layout" "==" "archives") -}} +{{- if $query -}} + {{- $archivesPage := index $query 0 -}} +
+
+ {{ partial "helper/icon" "infinity" }} +
+

{{ T "widget.archives.title" }}

- {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} - {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} - {{ $filtered := ($pages | intersect $notHidden) }} - {{ $archives := $filtered.GroupByDate "2006" }} - -
- {{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }} - {{- $id := lower (replace $item.Key " " "-") -}} - - {{ end }} -
-
\ No newline at end of file + {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} + {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} + {{ $filtered := ($pages | intersect $notHidden) }} + {{ $archives := $filtered.GroupByDate "2006" }} + +
+ {{ range $index, $item := first (add .Site.Params.widgets.archives.limit 1) ($archives) }} + {{- $id := lower (replace $item.Key " " "-") -}} + + {{ end }} +
+
+{{- else -}} + {{- warnf "Archives page not found. Create a page with layout: archives." -}} +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/widget/search.html b/layouts/partials/widget/search.html index 2275eb9..833f740 100644 --- a/layouts/partials/widget/search.html +++ b/layouts/partials/widget/search.html @@ -1,10 +1,16 @@ -
-

- - - - -

-
\ No newline at end of file +{{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}} +{{- if $query -}} + {{- $searchPage := index $query 0 -}} +
+

+ + + + +

+
+{{- else -}} + {{- warnf "Search page not found. Create a page with layout: search." -}} +{{- end -}} \ No newline at end of file