Skip to content

Commit 0e54351

Browse files
authored
Merge pull request #526 from SpineEventEngine/fix-blog
Fix the date rendering in the blog
2 parents 471c061 + 3850b7d commit 0e54351

File tree

4 files changed

+18
-58
lines changed

4 files changed

+18
-58
lines changed

site/layouts/_default/baseof.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
{{ partial "components/footer/footer.html" . }}
1515
</div>
1616
</div>
17-
{{ partial "components/cookie-notice.html" . }}
1817
{{ partial "scripts/body-scripts.html" . }}
1918
</body>
2019
</html>

site/layouts/_partials/blog/post-info.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@
2828
{{ $hasLabel := .has_label | default false }}
2929

3030
{{ $label := "" }}
31-
{{ if and (not $context.Params.author) $hasLabel }}
31+
{{ $postAuthor := $context.Params.author }}
32+
33+
{{ if and (not $postAuthor) $hasLabel }}
3234
{{ $label = "Posted on" }}
3335
{{ end }}
3436

3537
<div class="post-info">
36-
{{ with $context.Params.author }}
37-
<span class="post-author">{{ . }}</span>
38-
<span>on</span>
39-
{{ end }}
40-
{{ with $context.Params.publishdate }}
41-
{{ partial "components/iso-date.html" (dict
38+
{{- with $postAuthor -}}
39+
{{- $author := printf "%s %s&nbsp;" . "on" -}}
40+
<span class="post-author">{{ $author | safeHTML }}</span>
41+
{{- end -}}
42+
{{- with $context.Params.publishdate -}}
43+
{{- partial "components/iso-date.html" (dict
4244
"date" .
4345
"label" $label
44-
) }}
45-
{{ end }}
46+
) -}}
47+
{{- end -}}
4648
</div>

site/layouts/_partials/components/cookie-notice.html

Lines changed: 0 additions & 41 deletions
This file was deleted.

site/layouts/_partials/components/iso-date.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
~ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
-->
2626

27-
{{ $date := .date }}
28-
{{ $label := .label }}
27+
{{- $date := .date -}}
28+
{{- $label := .label -}}
2929

30-
{{ $formattedDate := $date | time.Format ":date_long" }}
31-
{{ $isoDate := $date | time.Format "2006-01-02" }}
30+
{{- $formattedDate := $date | time.Format ":date_long" -}}
31+
{{- $isoDate := $date | time.Format "2006-01-02" -}}
3232
<p class="date">
33-
{{ with $label }}
34-
{{ .}}
35-
{{ end }}
33+
{{- with $label -}}
34+
<span>{{ . }}&nbsp;</span>
35+
{{- end -}}
3636
<time datetime="{{ $isoDate }}">{{ $formattedDate }}</time>
3737
</p>

0 commit comments

Comments
 (0)