summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2024-09-29 18:12:59 +0200
committerSerghei Iakovlev <git@serghei.pl>2024-09-29 18:15:42 +0200
commit9620f0ff31fe3391e6d070c724d5f079c58b3746 (patch)
tree4c0b934273a5519a7d5c93b54fd8ef4485c4a7a3 /layouts
parent2eb7457e427c9e5ed697564dacef09c3a7f4a071 (diff)
downloadgohugo-theme-ed-9620f0ff31fe3391e6d070c724d5f079c58b3746.tar.gz
Code cleanup and minor fixes
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/index.json (renamed from layouts/index.json)6
-rw-r--r--layouts/partials/post-tags.html2
2 files changed, 4 insertions, 4 deletions
diff --git a/layouts/index.json b/layouts/_default/index.json
index de685ff..7f30c80 100644
--- a/layouts/index.json
+++ b/layouts/_default/index.json
@@ -1,7 +1,7 @@
{{- /* Generate the search index. */ -}}
{{- $pages := slice -}}
-{{- $mainSections := site.Params.mainSections | default (slice "posts") }}
+{{- $mainSections := site.Params.mainSections | default (slice "posts") -}}
{{- $pages = where site.RegularPages.ByDate.Reverse "Type" "in" $mainSections -}}
{{- $.Scratch.Add "pagesIndex" slice -}}
@@ -17,8 +17,8 @@
{{- /* Add page to index. */ -}}
{{- if not (in ($.Scratch.Get "urlsAdded") $page.Permalink) -}}
- {{/* Exclude virtual pages which aren't backed by a file */}}
- {{ if .File }}
+ {{- /* Exclude virtual pages which aren't backed by a file */ -}}
+ {{ if .File -}}
{{- $publishDate := $page.PublishDate -}}
{{- if $publishDate.IsZero -}}
diff --git a/layouts/partials/post-tags.html b/layouts/partials/post-tags.html
index 267bbab..68d29c2 100644
--- a/layouts/partials/post-tags.html
+++ b/layouts/partials/post-tags.html
@@ -4,7 +4,7 @@
<ul class="post-tags">
{{ range $index, $name := sort $tags -}}
<li>
- <a href="{{ (printf "/tags/%s/" $name) | urlize }}">
+ <a href="/tags/{{ (printf "%s" $name) | urlize }}">
{{ $name | markdownify }}
</a>
</li>