Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zwbetz-gh/minimal-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Betz <zwbetz@gmail.com>2018-12-06 20:36:19 +0300
committerZachary Betz <zwbetz@gmail.com>2018-12-06 20:36:19 +0300
commit38c27b4fbaca7b77361da62283dee2e692991400 (patch)
tree73f7b3d18510a50dc978d43a06627a53c2a5599b
parent66aa832c80c12687c129288adfca0977181bd605 (diff)
Move tags logic to partial
-rw-r--r--layouts/partials/post-list.html4
-rw-r--r--layouts/partials/tags.html3
-rw-r--r--layouts/post/single.html4
3 files changed, 5 insertions, 6 deletions
diff --git a/layouts/partials/post-list.html b/layouts/partials/post-list.html
index 9a8b0a3..77907b2 100644
--- a/layouts/partials/post-list.html
+++ b/layouts/partials/post-list.html
@@ -5,9 +5,7 @@
{{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
<br>
<small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
- {{ range .Params.tags }}
- <small><code><a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a></code></small>
- {{ end }}
+ {{ partial "tags" . }}
{{ if eq .Site.Params.showPostSummary true }}
<br>
{{ .Summary }}
diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html
new file mode 100644
index 0000000..8db7b00
--- /dev/null
+++ b/layouts/partials/tags.html
@@ -0,0 +1,3 @@
+{{ range .Params.tags }}
+<small><code><a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a></code></small>
+{{ end }} \ No newline at end of file
diff --git a/layouts/post/single.html b/layouts/post/single.html
index 933925f..9e34d6c 100644
--- a/layouts/post/single.html
+++ b/layouts/post/single.html
@@ -7,9 +7,7 @@
{{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
{{ .PublishDate.Format $customDateFormat }}{{ if gt .Lastmod .PublishDate }}, updated {{ .Lastmod.Format $customDateFormat }}{{ end }}
</small>
- {{ range .Params.tags }}
- <small><code><a href="{{ "/tags/" | absURL }}{{ . | urlize }}">{{ . }}</a></code></small>
- {{ end }}
+ {{ partial "tags" . }}
</p>
{{ .Content }}