-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hugo: update hugo and go, work around theme issue
There's an issue with the upstream theme on Hugo v0.123 that prevents the site from building. - lukeorth/poison#169
- Loading branch information
Showing
3 changed files
with
123 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{{ .Scratch.Set "title" .Site.Title }} | ||
|
||
{{ .Scratch.Set "publisherIcon" .Site.Params.favicon }} | ||
{{ if .Site.Params.publisherIcon }} | ||
{{ .Scratch.Set "publisherIcon" .Site.Params.publisher_icon }} | ||
{{ end }} | ||
|
||
{{ if eq .Kind "home" }} | ||
{{ .Scratch.Set "title" $.Site.Params.brand }} | ||
{{ .Scratch.Set "description" .Site.Params.Description }} | ||
{{ else }} | ||
{{ .Scratch.Set "description" .Description }} | ||
{{ end }} | ||
|
||
{{ if .IsSection }} | ||
{{ .Scratch.Set "title" ($.Site.Params.brand) }} | ||
{{ .Scratch.Add "title" " - " }} | ||
{{ .Scratch.Add "title" .LinkTitle }} | ||
{{ end }} | ||
|
||
{{ if .IsPage }} | ||
{{ .Scratch.Set "title" ($.Site.Params.brand) }} | ||
{{ .Scratch.Add "title" " - " }} | ||
{{ .Scratch.Add "title" .LinkTitle }} | ||
{{ end }} | ||
|
||
{{ "<!-- Open Graph image and Twitter Card metadata -->" | safeHTML }} | ||
{{ $image_path := .Params.image | default .Site.Params.og_image -}} | ||
{{ $image_path_local := printf "assets/%s" $image_path -}} | ||
{{ $image_ext := trim (path.Ext $image_path | lower) "." -}} | ||
{{ if fileExists $image_path_local -}} | ||
{{ $image_path:= resources.Get $image_path}} | ||
<meta property="og:image" content="{{ $image_path.RelPermalink }}" /> | ||
{{/* If not SVG, read image aspect ratio and define Twitter Card and Open Graph width and height */ -}} | ||
{{ if ne $image_ext "svg" -}} | ||
{{ with (imageConfig $image_path_local) -}} | ||
{{ if (and (gt .Width 144) (gt .Height 144)) -}} | ||
<meta name="twitter:image" content="{{ $image_path.RelPermalink }}"/> | ||
<meta name="twitter:card" content="summary{{ if (and (gt .Width 300) (gt .Height 157) (not (eq .Width .Height))) }}_large_image{{ end }}"> | ||
{{ end -}} | ||
<meta property="og:image:width" content="{{ .Width }}"> | ||
<meta property="og:image:height" content="{{ .Height }}"> | ||
{{ end -}} | ||
{{ end -}} | ||
<meta property="og:image:type" content="image/{{ if eq $image_ext `svg` }}svg+xml{{ else }}{{ replaceRE `^jpg$` `jpeg` $image_ext }}{{ end }}"> | ||
{{ end -}} | ||
|
||
<!-- Title Tags --> | ||
<title itemprop="name">{{ .Scratch.Get "title" }}</title> | ||
<meta property="og:title" content={{ .Scratch.Get "title" }} /> | ||
<meta name="twitter:title" content={{ .Scratch.Get "title" }} /> | ||
<meta itemprop="name" content={{ .Scratch.Get "title" }} /> | ||
<meta name="application-name" content={{ .Scratch.Get "title" }} /> | ||
<meta property="og:site_name" content="{{ .Site.Title }}" /> | ||
|
||
<!-- Description Tags --> | ||
<meta name="description" content="{{ .Scratch.Get "description" }}" /> | ||
<meta itemprop="description" content="{{ .Scratch.Get "description" }}" /> | ||
<meta property="og:description" content="{{ .Scratch.Get "description" }}" /> | ||
<meta name="twitter:description" content="{{ .Scratch.Get "description" }}" /> | ||
|
||
<!-- Link Tags --> | ||
<base href="{{ .Permalink }}" /> | ||
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" /> | ||
<meta name="url" content="{{ .Permalink }}" /> | ||
<meta name="twitter:url" content="{{ .Permalink }}" /> | ||
<meta property="og:url" content="{{ .Permalink }}" /> | ||
|
||
<!-- Date Tags --> | ||
<meta property="og:updated_time" content={{ .Lastmod.Format "2001-02-03T14:05:06Z0700" | safeHTML }} /> | ||
|
||
<!-- Sitemap & Alternate Outputs --> | ||
<link rel="sitemap" type="application/xml" title="Sitemap" href='{{ "sitemap.xml" | absURL }}' /> | ||
{{ range .AlternativeOutputFormats -}} | ||
{{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }} | ||
{{ end -}} | ||
|
||
<!-- Search Engine Crawler Tags --> | ||
<meta name="robots" content="index,follow" /> | ||
<meta name="googlebot" content="index,follow" /> | ||
|
||
<!-- Social Media Tags --> | ||
<meta name="twitter:site" content="{{ .Site.Params.twitter_url }}" /> | ||
<meta name="twitter:creator" content="{{ .Site.Params.twitter_url }}" /> | ||
<meta property="fb:admins" content="{{ .Site.Params.fb.admins }}" /> | ||
|
||
<!-- Other Tags --> | ||
<meta name="apple-mobile-web-app-title" content="{{ .Site.Title }}" /> | ||
<meta name="apple-mobile-web-app-capable" content="yes" /> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
|
||
<!-- Article Specific Tags --> | ||
<!-- To make sure this renders only in the article page, we check the section --> | ||
{{ if eq .Section "posts" }} | ||
|
||
<meta property="og:type" content="article" /> | ||
<meta property="article:publisher" content="{{ .Site.Params.facebook_url }}" /> | ||
<meta property="og:article:published_time" content={{ .Date.Format "2001-02-03T14:05:06Z0700" | safeHTML }} /> | ||
<meta property="article:published_time" content={{ .Date.Format "2001-02-03T14:05:06Z0700" | safeHTML }} /> | ||
|
||
{{ with.Params.author }} | ||
<meta property="og:article:author" content="{{humanize . }}" /> | ||
<meta property="article:author" content="{{humanize . }}" /> | ||
<meta name="author" content="{{humanize . }}" /> | ||
{{ end }} | ||
|
||
{{ with.Params.category }} | ||
<meta name="news_keywords" content="{{ index . 0 }}" /> | ||
<meta property="article:section" content="{{ index . 0 }}" /> | ||
{{ end }} | ||
|
||
{{ end }} | ||
|
||
<!-- Hugo Generator Attribution --> | ||
{{ hugo.Generator }} |