Skip to content
Permalink
Browse files

Hide dates when date is not present. (#253)

* Hide dates when is not present.

* Show pipe when both are present.
  • Loading branch information
ryanfox1985 committed Dec 13, 2019
1 parent e45210f commit 232f219ee77aee3b539ed18417c02e328c3b4630
@@ -1,6 +1,5 @@
+++
title = "Migrate from Jekyll"
date = "2015-10-10T13:07:31+02:00"
tags = ["ipsum"]
categories = ["lorem"]
banner = "img/banners/banner-5.jpg"
@@ -51,9 +51,11 @@ <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
{{ 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>
@@ -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 }}
@@ -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'>

0 comments on commit 232f219

Please sign in to comment.
You can’t perform that action at this time.