mirror of
https://github.com/skoelle/buildbroken-blog-archive.git
synced 2026-09-18 02:40:24 +00:00
many fixes
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
{{- $desc := "" }}
|
||||
{{- if .IsHome }}
|
||||
{{- $desc = .Site.Params.description }}
|
||||
{{- else if .Description }}
|
||||
{{- $desc = .Description }}
|
||||
{{- else if .Content }}
|
||||
{{- $desc = .Content | plainify }}
|
||||
{{- else if .IsNode }}
|
||||
@@ -57,8 +59,11 @@
|
||||
{{- if not $desc }}{{ $desc = .Summary | plainify }}{{ end }}
|
||||
{{- $desc = strings.TrimSpace (strings.TrimRight "…" $desc) | truncate 160 }}
|
||||
{{- if $desc }}<meta name="description" content="{{ $desc }}">{{ end }}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<meta property="og:type" content="{{ if .IsHome }}website{{ else }}article{{ end }}">
|
||||
{{- if eq .Kind "404" }}<meta name="robots" content="noindex">{{ end }}
|
||||
{{- if ne .Kind "404" }}<link rel="canonical" href="{{ .Permalink }}">{{ end }}
|
||||
{{- $ogType := "website" }}
|
||||
{{- if .IsPage }}{{ $ogType = "article" }}{{ end }}
|
||||
<meta property="og:type" content="{{ $ogType }}">
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}">
|
||||
<meta property="og:title" content="{{ $title }}">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
@@ -66,7 +71,7 @@
|
||||
{{- if .Params.images }}
|
||||
{{- range .Params.images }}<meta property="og:image" content="{{ . | absURL }}">{{ end }}
|
||||
{{- else }}<meta property="og:image" content="{{ .Site.Params.bannerImage | absURL }}">{{ end }}
|
||||
{{- if not .IsHome }}{{ with .Date }}<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}{{ end }}
|
||||
{{- if .IsPage }}{{ with .Date }}<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ end }}{{ end }}
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="{{ $title }}">
|
||||
{{- if $desc }}<meta name="twitter:description" content="{{ $desc }}">{{ end }}
|
||||
@@ -109,7 +114,7 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<script type="application/json" id="link-status-data">{{ (dict "broken" (site.Data.links.broken | default dict) "replacement" (site.Data.links.replacement | default dict)) | jsonify | safeJS }}</script>
|
||||
<script type="application/json" id="link-status-data">{{ (dict "broken" (hugo.Data.links.broken | default dict) "replacement" (hugo.Data.links.replacement | default dict)) | jsonify | safeJS }}</script>
|
||||
<script src="{{ "js/link-status.js" | relURL }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user