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

github.com/azmelanar/hugo-theme-pixyll.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmytro Slupytskyi <dslupytskyi@gmail.com>2020-01-09 22:10:52 +0300
committerGitHub <noreply@github.com>2020-01-09 22:10:52 +0300
commite2a3f5c19829becaff76f015d7e6db982ea6c1bd (patch)
treef76e2fd82a92757ebf496a0295199c35659de8c9
parentda1c16ad98b114e4eaa309c8b6e8d0013318fe92 (diff)
parent7e18aaaa2bce02b8f64eec13559351e4190eba23 (diff)
Merge pull request #35 from imyousuf/author_tag
Make author and tag being displayed dependent on them being available
-rw-r--r--layouts/post/single.html4
-rw-r--r--layouts/post/summary.html4
2 files changed, 6 insertions, 2 deletions
diff --git a/layouts/post/single.html b/layouts/post/single.html
index 3e6c8a1..6ebe1ab 100644
--- a/layouts/post/single.html
+++ b/layouts/post/single.html
@@ -5,7 +5,7 @@
<div class="measure">
<div class="post-header mb2">
<h1 class="py2">{{ .Title }}</h1>
- <span class="post-meta">{{ .Date.Format "Jan 2, 2006" }} by {{ .Params.author }}</span><br>
+ <span class="post-meta">{{ .Date.Format "Jan 2, 2006" }} {{ if isset .Params "author" }} by {{ .Params.author }} {{ end }}</span><br>
{{ $baseurl := .Site.BaseURL }}
</div>
@@ -13,12 +13,14 @@
{{ .Content }}
</article>
+ {{ if isset .Params "tags" }} {{ if len .Params.tags }}
<p class="post-meta">{{ i18n "tags" }}:&nbsp;
{{ range $i, $e := .Params.tags }}
{{if $i}},&nbsp;{{end}}
<a href="{{ $baseurl }}{{ $.Site.LanguagePrefix }}/tags/{{ . }}">{{ . }}</a>
{{ end }}
</p>
+ {{ end }} {{ end }}
{{ partial "comments.html" . }}
</div>
diff --git a/layouts/post/summary.html b/layouts/post/summary.html
index 03b3504..576b0af 100644
--- a/layouts/post/summary.html
+++ b/layouts/post/summary.html
@@ -1,15 +1,17 @@
<div class="post">
<a class="post-link" href="{{ .Permalink }}">
<p class="post-meta left">{{ .Date.Format "Jan 2, 2006" }}</p>
- <p class="post-author right">{{ i18n "written" }} {{ .Params.author }}</p>
+ {{ if isset .Params "author" }}<p class="post-author right">{{ i18n "written" }} {{ .Params.author }}</p>{{ end }}
<div class="clearfix"></div>
<h3 class="h2 post-title">{{ .Title }} {{ if .Draft }}(draft){{end}}</h3>
<p class="post-summary">{{ .Summary }}</p>
</a>
{{ $baseurl := .Site.BaseURL }}
+ {{ if isset .Params "tags" }} {{ if len .Params.tags }}
<p class="post-meta">{{ i18n "tags" }}:&nbsp;
{{ range $i, $e := .Params.tags }}
{{if $i}},&nbsp;{{end}}
<a href="{{ $baseurl }}{{ $.Site.LanguagePrefix }}/tags/{{ . }}">{{ . }}</a>
{{ end }}</p>
+ {{ end }}{{ end }}
</div>