From f3198e023509ec8d914869dd67ef88e5a39dfd78 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Thu, 25 Jun 2020 10:35:59 -0400 Subject: [PATCH] clean up a bunch of layouts, especially social-images function also made even more config.toml parameters optional, will help when finally releasing theme --- .prettierignore | 2 +- README.md | 6 +- .../js/{simple-analytics.js => analytics.js} | 25 +++---- .../emoji/emoji.js => js/vendor/twemoji.js} | 0 assets/sass/components/_global.scss | 1 + assets/sass/main.scss | 2 +- config.toml | 13 ++-- layouts/_default/baseof.html | 4 +- layouts/_default/single.amp.html | 6 +- layouts/_default/single.html | 2 +- layouts/index.atom | 5 +- layouts/index.webmanifest | 2 +- layouts/partials/functions/inline-svg.html | 20 +++--- .../partials/functions/optimize-image.html | 4 +- layouts/partials/functions/social-images.html | 47 +++++++------ layouts/partials/head/_head.html | 8 +-- layouts/partials/head/canonical.html | 2 +- layouts/partials/head/favicons.html | 6 +- layouts/partials/head/open-graph.html | 18 ++--- layouts/partials/head/schema.html | 7 +- layouts/partials/head/schema/article.html | 20 +++--- layouts/partials/head/schema/person.html | 10 +-- layouts/partials/head/styles.html | 6 +- layouts/partials/head/webmention.html | 2 +- layouts/partials/page/footer.html | 4 +- layouts/partials/page/header.html | 4 +- layouts/partials/scripts/_bundle.html | 22 +++--- layouts/rss.xml | 5 +- layouts/shortcodes/video.amp.html | 2 +- netlify.toml | 68 ++++++++++--------- yarn.lock | 6 +- 31 files changed, 167 insertions(+), 162 deletions(-) rename assets/js/{simple-analytics.js => analytics.js} (99%) rename assets/{vendor/emoji/emoji.js => js/vendor/twemoji.js} (100%) diff --git a/.prettierignore b/.prettierignore index 2c8d6987..8909a0d6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,5 @@ # Hugo stuff that doesn't play well with Prettier -assets/vendor/ +assets/**/vendor/ layouts/ static/ diff --git a/README.md b/README.md index abd75e96..1d34ccb3 100644 --- a/README.md +++ b/README.md @@ -25,15 +25,15 @@ Run `yarn install` ([Yarn must be installed](https://yarnpkg.com/en/docs/install ### 🐳 Using Docker: -To ensure consistency and compatibility, the [`Dockerfile`](Dockerfile) in this repository will download the correct versino of the Hugo Extended binary and its dependencies, and start a live testing server in the temporary container. +To ensure consistency and compatibility, the [`Dockerfile`](Dockerfile) in this repository will download the correct version of the Hugo Extended binary and its dependencies, and start a live testing server in a temporary container. -Using Docker doesn't require Node or Yarn, but you can also use `yarn start:docker` which simply runs: +Using Docker doesn't require Node or Yarn, but you can also use `yarn start:docker` (or `npm run start:docker`) which is simply an alias for: ```bash docker run --rm -v $(pwd):/src -p 1337:1337 $(docker build --no-cache -q .) ``` -...then open [http://localhost:1337/](http://localhost:1337/). +Once built, these two methods act identically — simply open [http://localhost:1337/](http://localhost:1337/) as above. ### 🤯 Why does this sound _way_ more complex than it needs to be?! diff --git a/assets/js/simple-analytics.js b/assets/js/analytics.js similarity index 99% rename from assets/js/simple-analytics.js rename to assets/js/analytics.js index d1c5d040..c41361ac 100644 --- a/assets/js/simple-analytics.js +++ b/assets/js/analytics.js @@ -8,25 +8,28 @@ // Generate the needed variables, this seems like a lot of repetition, but it // makes our script availble for multple destination which prevents us to // need multiple scripts. The minified version stays small. - var https = "https:"; + var version = 3; + var functionName = "sa_event"; var pageviewsText = "pageview"; + var https = "https:"; var protocol = https + "//"; - var con = window.console; var slash = "/"; + var fullApiUrl = protocol + baseUrl; + var doc = window.document; + var con = window.console; var nav = window.navigator; + var screen = window.screen; var loc = window.location; var locationHostname = loc.hostname; - var doc = window.document; var userAgent = nav.userAgent; - var notSending = "Not sending requests "; + var documentElement = doc.documentElement || {}; + var addEventListenerFunc = window.addEventListener; var encodeURIComponentFunc = encodeURIComponent; var decodeURIComponentFunc = decodeURIComponent; var stringify = JSON.stringify; var thousand = 1000; - var addEventListenerFunc = window.addEventListener; - var fullApiUrl = protocol + baseUrl; var undefinedVar = undefined; - var documentElement = doc.documentElement || {}; + var notSending = "Not sending requests "; var language = "language"; var Height = "Height"; var Width = "Width"; @@ -35,14 +38,12 @@ var offsetHeight = "offset" + Height; var clientHeight = "client" + Height; var clientWidth = "client" + Width; - var screen = window.screen; - var functionName = "sa_event"; - - var bot = /(bot|spider|crawl)/i.test(userAgent); var payload = { - version: 3, + version: version, }; + + var bot = /(bot|spider|crawl)/i.test(userAgent); if (bot) payload.bot = true; var options = { diff --git a/assets/vendor/emoji/emoji.js b/assets/js/vendor/twemoji.js similarity index 100% rename from assets/vendor/emoji/emoji.js rename to assets/js/vendor/twemoji.js diff --git a/assets/sass/components/_global.scss b/assets/sass/components/_global.scss index 56244a98..9d807ab4 100644 --- a/assets/sass/components/_global.scss +++ b/assets/sass/components/_global.scss @@ -113,6 +113,7 @@ button { img.emoji { height: 1.1em; width: 1.1em; + margin: 0; padding: 0 0.09em; vertical-align: -0.18em; diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 267d6f1c..18b65a81 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -2,7 +2,7 @@ // NOTE: all variables set by Hugo's config.toml MUST go here: // prettier-ignore -$max-width: "{{ printf "%d%s" .Site.Params.pageMaxWidth "px" }}"; +$max-width: "{{ printf "%d%s" .Site.Params.maxWidth "px" }}"; $base-url: "{{ strings.TrimRight "/" .Site.BaseURL }}" + "/"; // those values need quotes because, even though prettier & stylelint are correct diff --git a/config.toml b/config.toml index 1148cd56..db64fd5d 100644 --- a/config.toml +++ b/config.toml @@ -24,19 +24,19 @@ disableAliases = true [params] description = "Hi there! I'm a frontend web developer based in Boston, Massachusetts specializing in the JAMstack, modern JavaScript frameworks, and progressive web apps." - domain = "jarv.is" - mainSection = "notes" - pageMaxWidth = 940 - defaultImage = "img/me_large.jpg" - github = "jakejarvis/jarv.is" + image = "img/logo.png" # must be in assetDir + mainSection = "notes" # reflected in RSS, Atom, AMP + maxWidth = 940 # px + githubRepo = "jakejarvis/jarv.is" facebookAppID = "3357248167622283" - webmention = "jarv.is" + webmentionIO = "jarv.is" # webmention.io username copyrightFirstYear = "2001" license = "CC-BY-4.0" licenseFull = "Creative Commons Attribution 4.0 International" [author] name = "Jake Jarvis" + image = "img/me_large.jpg" # must be in assetDir jobTitle = "Front-End Web Developer" email = "jake@jarv.is" twitter = "jakejarvis" @@ -51,7 +51,6 @@ disableAliases = true [module] [[module.imports]] path = "github.com/twitter/twemoji" - disable = false [[module.imports.mounts]] source = "assets/svg" target = "static/vendor/emoji/svg" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3d5c9956..4fdba907 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -12,8 +12,8 @@ {{ block "main" . }}{{ end }} {{ partialCached "page/footer" . }} -{{ partial "scripts/_bundle" . }} -{{ partial "scripts/shortcodes" . }} +{{ partial "scripts/_bundle" . -}} +{{ partial "scripts/shortcodes" . -}} diff --git a/layouts/_default/single.amp.html b/layouts/_default/single.amp.html index 96a86b7e..9e144f4e 100644 --- a/layouts/_default/single.amp.html +++ b/layouts/_default/single.amp.html @@ -90,7 +90,7 @@ padding-left: 1em; } article { - max-width: {{ printf "%d%s" .Site.Params.pageMaxWidth "px" }}; + max-width: {{ printf "%d%s" .Site.Params.maxWidth "px" }}; margin: 0 auto; padding: 0 15px; line-height: 1.75; @@ -147,7 +147,7 @@ text-decoration: none; } nav { - max-width: {{ printf "%d%s" .Site.Params.pageMaxWidth "px" }}; + max-width: {{ printf "%d%s" .Site.Params.maxWidth "px" }}; margin: 0 auto; padding: 0 15px; display: flex; @@ -198,7 +198,7 @@ } footer div.row { width: 100%; - max-width: {{ printf "%d%s" .Site.Params.pageMaxWidth "px" }}; + max-width: {{ printf "%d%s" .Site.Params.maxWidth "px" }}; margin: 0 auto; display: flex; justify-content: space-between; diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8c7a7cf5..b8c85b6c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,7 +2,7 @@
- {{ .Date.Format "January 2, 2006" }}{{ with .Site.Params.github }}Improve This Post{{ end }} + {{ .Date.Format "January 2, 2006" }}{{ with .Site.Params.githubRepo }}Improve This Post{{ end }}

{{ .Title | markdownify }}

diff --git a/layouts/index.atom b/layouts/index.atom index b11af437..c9c448a0 100644 --- a/layouts/index.atom +++ b/layouts/index.atom @@ -1,3 +1,4 @@ +{{- $img := partial "functions/social-images" . -}} {{ printf "" | safeHTML }} {{ .Site.Title }} @@ -10,8 +11,8 @@ {{- with .Site.Copyright }} {{ . }} {{- end }} - {{- with .Site.Params.defaultImage }} - {{ . | absURL }} + {{- with .Scratch.Get "authorImage" }} + {{ .Permalink }} {{- end }} {{ .Date.Format "2006-01-02T15:04:05Z" | safeHTML }} {{- with .OutputFormats.Get "ATOM" }} diff --git a/layouts/index.webmanifest b/layouts/index.webmanifest index 0cffe3aa..ec01200b 100644 --- a/layouts/index.webmanifest +++ b/layouts/index.webmanifest @@ -2,7 +2,7 @@ {{- $android192 := resources.Get "img/android-chrome-192x192.png" -}} { "name": "{{ .Site.Title }}", - "short_name": "{{ .Site.Params.domain }}", + "short_name": "{{ (urls.Parse .Site.BaseURL).Host }}", "icons": [ { "src": "{{ $android512.Permalink | safeJS }}", diff --git a/layouts/partials/functions/inline-svg.html b/layouts/partials/functions/inline-svg.html index 563bac6c..fc2518ab 100644 --- a/layouts/partials/functions/inline-svg.html +++ b/layouts/partials/functions/inline-svg.html @@ -1,15 +1,15 @@ -{{ $svg := resources.Get .src -}} -{{ $html := $svg.Content -}} +{{- $svg := resources.Get .src -}} +{{- $html := $svg.Content -}} {{/* remove unneeded tags/attributes when SVG is inlined versus a .svg file */}} -{{ $html = replaceRE "<\\?xml.+\\?>" "" $html -}} -{{ $html = replaceRE " version=\"(.*?)\"" "" $html -}} -{{ $html = replaceRE " xmlns=\"(.*?)\"" "" $html -}} +{{- $html = replaceRE "<\\?xml.+\\?>" "" $html -}} +{{- $html = replaceRE " version=\"(.*?)\"" "" $html -}} +{{- $html = replaceRE " xmlns=\"(.*?)\"" "" $html -}} -{{ $wxh := printf "" $svg.Permalink | safeHTML }} -{{ $html | safeHTML -}} +{{/* bit of a hack: calling .Permalink so that the SVG file is published too, comment will be removed when minified */}} +{{- printf "" $svg.Permalink | safeHTML }} +{{- $html | safeHTML -}} diff --git a/layouts/partials/functions/optimize-image.html b/layouts/partials/functions/optimize-image.html index 2cfdaaf6..90bb22e6 100644 --- a/layouts/partials/functions/optimize-image.html +++ b/layouts/partials/functions/optimize-image.html @@ -3,7 +3,7 @@ {{ $original := .Page.Resources.GetMatch (.Get "src") }} {{ .Scratch.Set "image" $original }} -{{ $setWidth := .Site.Params.pageMaxWidth }} +{{ $setWidth := .Site.Params.maxWidth }} {{ if .Get "width" }} {{ $setWidth = (int (.Get "width")) }} @@ -22,4 +22,4 @@ {{ $displayWidth := $setWidth }} {{ $displayHeight := (math.Ceil (mul $origRatio $setWidth)) }} -{{ return (dict "Permalink" $image.Permalink "Width" $displayWidth "Height" $displayHeight) }} +{{ return (dict "Permalink" $image.Permalink "Width" $displayWidth "Height" $displayHeight "MediaType" $image.MediaType) }} diff --git a/layouts/partials/functions/social-images.html b/layouts/partials/functions/social-images.html index 833e0c2b..43e88a3f 100644 --- a/layouts/partials/functions/social-images.html +++ b/layouts/partials/functions/social-images.html @@ -1,28 +1,27 @@ -{{/* Default image */}} -{{- $defaultImage := resources.Get $.Site.Params.defaultImage }} -{{- $.Scratch.Set "defaultImage_url" $defaultImage.Permalink }} -{{- $.Scratch.Set "defaultImage_width" $defaultImage.Width }} -{{- $.Scratch.Set "defaultImage_height" $defaultImage.Height }} -{{- $.Scratch.Set "defaultImage_type" $defaultImage.MediaType }} +{{/* Chooses and initializes various images for use by JSON schema & open graph tags */}} + +{{/* Author image (default) */}} +{{- with .Site.Author.image -}} + {{- with resources.Get . -}} + {{- $.Scratch.Set "authorImage" . -}} + {{- end -}} +{{- end -}} {{/* Article image */}} -{{- with .Params.image }} - {{- $socialImage := $.Page.Resources.GetMatch . }} - {{- $.Scratch.Set "socialImage_url" $socialImage.Permalink }} - {{- $.Scratch.Set "socialImage_width" $socialImage.Width }} - {{- $.Scratch.Set "socialImage_height" $socialImage.Height }} - {{- $.Scratch.Set "socialImage_type" $socialImage.MediaType }} -{{ else }} - {{/* fallback to default image set above */}} - {{- $.Scratch.Set "socialImage_url" $defaultImage.Permalink }} - {{- $.Scratch.Set "socialImage_width" $defaultImage.Width }} - {{- $.Scratch.Set "socialImage_height" $defaultImage.Height }} - {{- $.Scratch.Set "socialImage_type" $defaultImage.MediaType }} -{{ end -}} +{{- with .Params.image -}} + {{- with $.Page.Resources.GetMatch . -}} + {{- $.Scratch.Set "pageImage" . -}} + {{- end -}} +{{- else -}} + {{/* Fallback to author image set above */}} + {{- with $.Scratch.Get "authorImage" -}} + {{- $.Scratch.Set "pageImage" . -}} + {{- end -}} +{{- end -}} {{/* Site logo */}} -{{- $logoImage := resources.Get "img/logo.png" }} -{{- $.Scratch.Set "logoImage_url" $logoImage.Permalink }} -{{- $.Scratch.Set "logoImage_width" $logoImage.Width }} -{{- $.Scratch.Set "logoImage_height" $logoImage.Height }} -{{- $.Scratch.Set "logoImage_type" $logoImage.MediaType }} +{{- with .Site.Params.image -}} + {{- with resources.Get . -}} + {{- $.Scratch.Set "logoImage" . -}} + {{- end -}} +{{- end -}} diff --git a/layouts/partials/head/_head.html b/layouts/partials/head/_head.html index 15e06955..0072d1ea 100644 --- a/layouts/partials/head/_head.html +++ b/layouts/partials/head/_head.html @@ -2,13 +2,13 @@ {{ partial "functions/social-images" . -}} {{ partial "head/open-graph" . -}} {{ partialCached "head/mobile" . -}} -{{ partial "head/preload" . -}} +{{ partialCached "head/preload" . -}} {{ partial "head/styles" . -}} {{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32 48") -}} {{ partialCached "head/feeds" . -}} {{ partialCached "head/webmention" . -}} {{ partial "head/canonical" . -}} {{ partial "head/schema" . -}} -{{ if eq hugo.Environment "production" }} - {{ partial "scripts/simple_analytics_events" . -}} -{{ end }} +{{ if eq hugo.Environment "production" -}} + {{ partialCached "scripts/simple_analytics_events" . -}} +{{ end -}} diff --git a/layouts/partials/head/canonical.html b/layouts/partials/head/canonical.html index cd6aa279..4b9aeec8 100644 --- a/layouts/partials/head/canonical.html +++ b/layouts/partials/head/canonical.html @@ -1,7 +1,7 @@ {{ if and .IsPage (eq .Type .Site.Params.mainSection) }} {{- with .OutputFormats.Get "amp" -}} - + {{ end -}} {{ end -}} - - - - - +{{- with .Scratch.Get "pageImage" }} + + + + + +{{ end -}} {{- if and .IsPage (eq .Type .Site.Params.mainSection) }} {{- if not .PublishDate.IsZero }} @@ -23,16 +25,16 @@ {{ end }} {{- with .Params.tags }}{{ range . }} {{ end }}{{ end }} -{{- end }} +{{ end -}} {{ with .Site.Author.facebookid }}{{ end }} {{ with .Site.Params.facebookAppID }}{{ end }} - + {{- with .Site.Author.twitter }} -{{- end }} +{{ end -}} {{ with .Site.Author.twitterid }}{{ end }} diff --git a/layouts/partials/head/schema.html b/layouts/partials/head/schema.html index 78603fab..76dbbead 100644 --- a/layouts/partials/head/schema.html +++ b/layouts/partials/head/schema.html @@ -1,6 +1,5 @@ +{{ partial "head/schema/person" . -}} + {{ if and .IsPage (eq .Type .Site.Params.mainSection) }} - {{ partial "head/schema/person" . }} - {{ partial "head/schema/article" . }} -{{ else }} - {{ partial "head/schema/person" . }} + {{ partial "head/schema/article" . -}} {{ end -}} diff --git a/layouts/partials/head/schema/article.html b/layouts/partials/head/schema/article.html index 7371d15c..a92d68e6 100644 --- a/layouts/partials/head/schema/article.html +++ b/layouts/partials/head/schema/article.html @@ -17,19 +17,19 @@ "publisher": { "@type": "Organization", "name": {{ .Site.Title }}, - "url": {{ .Site.BaseURL }}, + "url": {{ .Site.BaseURL }}{{ with .Scratch.Get "logoImage" }}, "logo": { "@type": "ImageObject", - "url": {{ .Scratch.Get "logoImage_url" | absURL }}, - "width": "{{ .Scratch.Get "logoImage_width" }}", - "height": "{{ .Scratch.Get "logoImage_height" }}" - } - }, + "url": {{ .Permalink }}, + "width": "{{ .Width }}", + "height": "{{ .Height }}" + }{{ end }} + }{{ with .Scratch.Get "pageImage" }}, "image": { "@type": "ImageObject", - "url": {{ .Scratch.Get "socialImage_url" | absURL }}, - "width": "{{ .Scratch.Get "socialImage_width" }}", - "height": "{{ .Scratch.Get "socialImage_height" }}" - } + "url": {{ .Permalink }}, + "width": "{{ .Width }}", + "height": "{{ .Height }}" + }{{ end }} } diff --git a/layouts/partials/head/schema/person.html b/layouts/partials/head/schema/person.html index dadbcb1c..9180ac07 100644 --- a/layouts/partials/head/schema/person.html +++ b/layouts/partials/head/schema/person.html @@ -7,13 +7,13 @@ "name": {{ .name }}, "url": {{ $.Site.BaseURL }}, "description": {{ $.Site.Params.description }}, - {{ with .jobtitle }}"jobTitle": {{ . }},{{ end }} + {{ with .jobtitle }}"jobTitle": {{ . }},{{ end }}{{ with $.Scratch.Get "authorImage" }} "image": { "@type": "ImageObject", - "url": {{ $.Scratch.Get "defaultImage_url" | absURL }}, - "width": "{{ $.Scratch.Get "defaultImage_width" }}", - "height": "{{ $.Scratch.Get "defaultImage_height" }}" - }, + "url": {{ .Permalink }}, + "width": "{{ .Width }}", + "height": "{{ .Height }}" + },{{ end }} "sameAs": [ {{ $.Site.BaseURL }}, {{ with .github }}{{ printf "%s%s" "https://github.com/" . }},{{ end }} diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html index e226bc2e..4c4201fb 100644 --- a/layouts/partials/head/styles.html +++ b/layouts/partials/head/styles.html @@ -2,9 +2,9 @@ {{/* Page-specific styles set via front matter, scoped via SCSS and inlined */}} -{{ with .Params.css }} +{{- with .Params.css -}} {{/* NOTE: This file doesn't end up getting published (which is good) */}} - {{- $target := path.Join $.File.Dir "css/inline.scss" }} + {{- $target := path.Join $.File.Dir "css/inline.scss" -}} {{- $css := . | resources.FromString $target | resources.ToCSS | resources.PostCSS (dict "config" "postcss.config.js") -}} {{/* Already being minified to my taste by PostCSS above */}} @@ -13,4 +13,4 @@ {{ $css.Content | safeCSS }} {{- printf "" | safeHTML }} -{{ end }} +{{ end -}} diff --git a/layouts/partials/head/webmention.html b/layouts/partials/head/webmention.html index 5ba43705..4e71a10c 100644 --- a/layouts/partials/head/webmention.html +++ b/layouts/partials/head/webmention.html @@ -1,4 +1,4 @@ -{{ with .Site.Params.webmention }} +{{ with .Site.Params.webmentionIO }} {{ end }} diff --git a/layouts/partials/page/footer.html b/layouts/partials/page/footer.html index 0ede6632..96557e5c 100644 --- a/layouts/partials/page/footer.html +++ b/layouts/partials/page/footer.html @@ -1,12 +1,10 @@ diff --git a/layouts/partials/page/header.html b/layouts/partials/page/header.html index dd77e8ca..ad8b8c28 100644 --- a/layouts/partials/page/header.html +++ b/layouts/partials/page/header.html @@ -1,13 +1,13 @@
diff --git a/layouts/partials/scripts/_bundle.html b/layouts/partials/scripts/_bundle.html index 6ff08063..20569ee0 100644 --- a/layouts/partials/scripts/_bundle.html +++ b/layouts/partials/scripts/_bundle.html @@ -1,20 +1,20 @@ -{{ $darkmode := resources.Get "js/dark-mode.js" | resources.ExecuteAsTemplate "js/dark-mode.js" . }} -{{ $twemoji := resources.Get "vendor/emoji/emoji.js" | resources.ExecuteAsTemplate "vendor/emoji/emoji.min.js" . }} +{{- $darkmode := resources.Get "js/dark-mode.js" | resources.ExecuteAsTemplate "js/dark-mode.js" . -}} +{{- $twemoji := resources.Get "js/vendor/twemoji.js" | resources.ExecuteAsTemplate "js/vendor/twemoji.js" . -}} -{{ $bundle := slice $darkmode $twemoji }} +{{- $bundle := slice $darkmode $twemoji -}} {{/* only parse and append analytics script on production site */}} -{{ $includeAnalytics := eq hugo.Environment "production" }} +{{- $includeAnalytics := eq hugo.Environment "production" -}} -{{ if $includeAnalytics }} - {{ $analytics := resources.Get "js/simple-analytics.js" | resources.ExecuteAsTemplate "js/simple-analytics.js" . }} - {{ $bundle = slice $darkmode $twemoji $analytics }} -{{ end }} +{{- if $includeAnalytics }} + {{- $analytics := resources.Get "js/analytics.js" | resources.ExecuteAsTemplate "js/analytics.js" . }} + {{- $bundle = slice $darkmode $twemoji $analytics }} +{{- end }} -{{ $js := $bundle | resources.Concat "/js/app.js" }} +{{- $js := $bundle | resources.Concat "/js/app.js" -}} {{/* proxy to simple analytics noscript on production */}} -{{ if $includeAnalytics }} +{{- if $includeAnalytics }} -{{ end }} +{{ end -}} diff --git a/layouts/rss.xml b/layouts/rss.xml index 54a824f1..24e8f07c 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -1,3 +1,4 @@ +{{- $img := partial "functions/social-images" . -}} {{ .Site.Title }} @@ -8,9 +9,9 @@ {{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Author.email }} {{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} {{ . }}{{ end }}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}{{ with .Site.Params.defaultImage }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }}{{ with .Scratch.Get "authorImage" }} - {{ . | absURL }} + {{ .Permalink }} {{ $.Site.Title }} {{ $.Permalink }} {{ end }}{{ with .OutputFormats.Get "RSS" }} diff --git a/layouts/shortcodes/video.amp.html b/layouts/shortcodes/video.amp.html index 0c0f1439..87b539b0 100644 --- a/layouts/shortcodes/video.amp.html +++ b/layouts/shortcodes/video.amp.html @@ -1,6 +1,6 @@