aboutsummaryrefslogtreecommitdiff
path: root/themes/base/layouts/partials/function-page-modified.html
blob: ddcfbf3c78b40d58523e50b8aa450ee8968f215b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 -}}