aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/function-page-modified.html
blob: f03ee6f156e6bc1cb5bd6790e85ab3c964814874 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{{- $input := . -}}
{{- $pageContext := $input -}}

{{- $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 -}}