Skip to content

Commit

Permalink
show modified date instead of published date
Browse files Browse the repository at this point in the history
  • Loading branch information
thombergs committed Aug 5, 2024
1 parent 3abcec2 commit c34f0b7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
7 changes: 6 additions & 1 deletion themes/geeky/layouts/_default/post.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{{ $author := (index .Site.Data.authors .Params.authors) }}

{{ $.Scratch.Set "articleDate" .PublishDate }}
{{ if .Params.lastmod }}
{{ $.Scratch.Set "articleDate" .Params.lastmod }}
{{ end }}

<div class="card">
<!-- image path -->
{{ $imagePath:= .Params.image }}
Expand Down Expand Up @@ -62,7 +67,7 @@ <h3 class="h6">
</li>
<li class="list-inline-item d-flex align-items-center">
<i class="fas fa-calendar me-2"></i>
<span>{{ time.Format ":date_long" .PublishDate }}</span>
<span>{{ time.Format ":date_long" ($.Scratch.Get "articleDate") }}</span>
</li>
</ul>
<p class="card-text small mb-3">{{ .Summary }}</p>
Expand Down
18 changes: 13 additions & 5 deletions themes/geeky/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<!-- checking blog -->
{{ if or (eq .Section "post") (eq .Section "posts") (eq .Section "blog") (eq .Section "blogs") (eq .Section "news") (eq .Section "categories") (eq .Section "tags") }}

{{ $author := (index .Site.Data.authors .Params.authors) }}
{{ $.Scratch.Set "articleDate" .PublishDate }}
{{ if .Params.lastmod }}
{{ $.Scratch.Set "articleDate" .Params.lastmod }}
{{ end }}

<!--=================== section start ===================-->
<section class="section-sm">
Expand All @@ -16,7 +19,7 @@ <h1 class="mb-4 h2">{{.Title | markdownify}}</h1>
<ul class="list-inline d-flex align-items-center mb-4">
<li class="list-inline-item d-flex align-items-center me-4">
<i class="fas fa-calendar me-2"></i>
<span data-blogtrack-date>{{ time.Format ":date_long" .PublishDate }}</span>
<span data-blogtrack-date>{{ time.Format ":date_long" ($.Scratch.Get "articleDate") }}</span>
</li>
<li class="list-inline-item d-flex align-items-center">
<i class="fas fa-archive me-2"></i>
Expand Down Expand Up @@ -47,9 +50,14 @@ <h2>In this article</h2>

<div class="content" data-blogtrack-text>{{.Content}}</div>

{{ $author := (index .Site.Data.authors .Params.authors) }}

{{ partial "author-blurb.html" $author }}
{{ $authors := .Params.authors | default slice }}
{{ range $index, $authorID := $authors }}
{{ $author := index $.Site.Data.authors $authorID }}
{{ partial "author-blurb.html" $author }}
{{ if ne (add $index 1) (len $authors) }}
<div style="margin-bottom: 2rem;"></div>
{{ end }}
{{ end }}

<!-- disqus comments -->
{{ if .Site.DisqusShortname }}
Expand Down

0 comments on commit c34f0b7

Please sign in to comment.