diff options
author | tdro <tdro@noreply.example.com> | 2023-01-31 21:56:21 -0500 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-01-31 21:58:38 -0500 |
commit | 0e57d29f33a6fe4b8ec8a92b98c069305f531a19 (patch) | |
tree | 52ba18c739b12edef45815a0756604af4a3a1177 /themes/base/layouts/partials/function-page-modified.html | |
download | hugo-theme-base-0e57d29f33a6fe4b8ec8a92b98c069305f531a19.tar.gz hugo-theme-base-0e57d29f33a6fe4b8ec8a92b98c069305f531a19.tar.bz2 hugo-theme-base-0e57d29f33a6fe4b8ec8a92b98c069305f531a19.zip |
themes/base: Commit
Diffstat (limited to 'themes/base/layouts/partials/function-page-modified.html')
-rw-r--r-- | themes/base/layouts/partials/function-page-modified.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/themes/base/layouts/partials/function-page-modified.html b/themes/base/layouts/partials/function-page-modified.html new file mode 100644 index 0000000..ddcfbf3 --- /dev/null +++ b/themes/base/layouts/partials/function-page-modified.html @@ -0,0 +1,32 @@ +{{- $input := . -}} +{{- $pageContext := $input -}} + +{{- $author := $pageContext.Section -}} +{{- $markdown := print "content/" $pageContext.File -}} +{{- $markdownModTime := "" -}} +{{- $page := print "public/" (strings.TrimPrefix + $pageContext.Page.Site.BaseURL + $pageContext.Page.Permalink + ) "index.html" +-}} +{{- $pageModTime := "" -}} + +{{- if fileExists $markdown -}} + {{- $markdownModTime = (os.Stat $markdown).ModTime -}} +{{- end -}} + +{{- if fileExists $page -}} + {{- $pageModTime = (os.Stat $page).ModTime -}} +{{- end -}} + +{{- $modified := gt $markdownModTime $pageModTime -}} + +{{- $output := or $modified (in (slice + "home" + "section" + "taxonomy" + "term" + ) $pageContext.Page.Kind) +-}} + +{{- return $output -}} |