diff options
author | Guillermo Guerrero Ibarra <wolf.fox1985@gmail.com> | 2019-12-13 13:39:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-13 13:39:24 +0300 |
commit | 232f219ee77aee3b539ed18417c02e328c3b4630 (patch) | |
tree | 494ccb0de32c35adc8a6957c6ebfac71ecdb7758 /layouts | |
parent | e45210fd7697670746444928a15e2e28eaf370e0 (diff) |
Hide dates when date is not present. (#253)
* Hide dates when is not present.
* Show pipe when both are present.
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/_default/single.html | 8 | ||||
-rw-r--r-- | layouts/partials/head.html | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 647dddc..1c15091 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -51,9 +51,11 @@ {{ end }} </p> + {{ if isset .Params "date" }} <p class="date-comments"> <a href="{{ .Permalink }}"><i class="far fa-calendar"></i> {{ .Date.Format .Site.Params.date_format }}</a> </p> + {{ end }} </div> <p class="intro">{{ .Summary }}</p> <p class="read-more"><a href="{{ .Permalink }}" class="btn btn-template-main">{{ i18n "continueReading" }}</a> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 49ea68b..eff822f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -24,7 +24,13 @@ <div class="col-md-9" id="blog-post"> - <p class="text-muted text-uppercase mb-small text-right">{{ if .Params.author }}{{ i18n "authorBy" }} <a href="#">{{ .Params.author }}</a> | {{ end }}{{ .Date.Format .Site.Params.date_format }}</p> + {{ if or .Params.author .Params.date }} + <p class="text-muted text-uppercase mb-small text-right"> + {{ if .Params.author }}{{ i18n "authorBy" }} <a href="#">{{ .Params.author }}</a>{{ end }} + {{ if and .Params.author .Params.date }} | {{ end }} + {{ if .Params.date }}{{ .Date.Format .Site.Params.date_format }}{{ end }} + </p> + {{ end }} <div id="post-content"> {{ .Content }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8b7d655..a368d16 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -15,7 +15,7 @@ {{ $description_plain := default .Site.Params.defaultDescription .Description | markdownify | plainify }} <meta name="description" content="{{ $description_plain }}"> - {{ .Hugo.Generator }} + {{ hugo.Generator }} <!-- Font --> <link href='//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800' rel='stylesheet' type='text/css'> |