AstraOS commited on
Commit
514fdfe
·
verified ·
1 Parent(s): f170a7d

Update app/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/base.html

Browse files
app/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/base.html CHANGED
@@ -32,9 +32,20 @@
32
  <meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
33
  {{- end -}}
34
  {{- else -}}
35
- {{- if not .Site.Lastmod.IsZero -}}
36
  <meta property='og:updated_time' content='{{ .Site.Lastmod.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
 
 
 
 
 
 
 
 
 
 
37
  {{- end -}}
 
38
  {{- end -}}
39
 
40
  {{ $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }}
 
32
  <meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
33
  {{- end -}}
34
  {{- else -}}
35
+ <!-- {{- if not .Site.Lastmod.IsZero -}}
36
  <meta property='og:updated_time' content='{{ .Site.Lastmod.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
37
+ {{- end -}} -->
38
+
39
+ {{- $lastmod := now -}}
40
+ {{- range .Site.RegularPages -}}
41
+ {{- if gt .Lastmod $lastmod -}}
42
+ {{- $lastmod = .Lastmod -}}
43
+ {{- end -}}
44
+ {{- end -}}
45
+ {{- if gt $lastmod (time "2000-01-01") -}}
46
+ <meta property='og:updated_time' content='{{ $lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
47
  {{- end -}}
48
+
49
  {{- end -}}
50
 
51
  {{ $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }}