Skip to content

Commit

Permalink
Merge pull request #273 from henryiii/henryiii-lastmod
Browse files Browse the repository at this point in the history
Adding last modified for pages if lastmod is set
  • Loading branch information
halogenica authored Sep 21, 2019
2 parents 6f54c9a + 491837e commit 3836f4c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{ if eq .Type "page" }}
{{ partial "page_meta.html" . }}
{{ end }}
<footer>
<div class="container">
<div class="row">
Expand Down
8 changes: 8 additions & 0 deletions layouts/partials/page_meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="page-meta">
{{ $lastmodstr := default (i18n "dateFormat") .Site.Params.dateformat | .Lastmod.Format }}
{{ $datestr := default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format }}
{{ if ne $datestr $lastmodstr }}
{{ $lastmodstr | i18n "lastModified" }}
{{ end }}
</div>

9 changes: 7 additions & 2 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,19 @@ footer .theme-by {
margin-bottom: 10px;
}
.post-preview .post-meta,
.post-heading .post-meta {
.post-heading .post-meta,
.page-meta {
color: #808080;
font-size: 18px;
font-style: italic;
margin: 0 0 10px;
}
.page-meta {
align-self: center;
}
.post-preview .post-meta a,
.post-heading .post-meta a {
.post-heading .post-meta a,
.page-meta a {
color: #404040;
text-decoration: none;
}
Expand Down

0 comments on commit 3836f4c

Please sign in to comment.