diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 33c340c0..875f57a7 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -5,11 +5,12 @@ {{ partial "head" . }} -{{ block "header" . }}{{ partial "header" . }}{{ end }} +{{ partial "header" . }}
{{ block "main" . }}{{ end }}
-{{ block "footer" . }}{{ partial "footer" . }}{{ end }} +{{ partial "footer" . }} +{{ partial "scripts" . }} diff --git a/layouts/_default/single.amp.html b/layouts/_default/single.amp.html index deac1e49..2cca052e 100644 --- a/layouts/_default/single.amp.html +++ b/layouts/_default/single.amp.html @@ -8,6 +8,7 @@ + {{ .Title }} – {{ .Site.Title }} {{ with .OutputFormats.Get "html" }}{{ end }} diff --git a/layouts/partials/commento.html b/layouts/partials/commento.html index e0b009c4..055d8c3a 100644 --- a/layouts/partials/commento.html +++ b/layouts/partials/commento.html @@ -1,2 +1,2 @@
- + diff --git a/layouts/partials/open-graph.html b/layouts/partials/open-graph.html index e6e5874c..eeceb867 100644 --- a/layouts/partials/open-graph.html +++ b/layouts/partials/open-graph.html @@ -44,4 +44,3 @@ {{- end }} {{ with .Site.Author.twitterid }}{{ end }} - diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 00000000..fe857f59 --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,14 @@ +{{- if .HasShortcode "gh-buttons"}} + +{{ end -}} + +{{- if .HasShortcode "tweet"}} + +{{ end -}} + +{{- if .HasShortcode "facebook"}} +
+ +{{ end -}} + +{{- template "_internal/google_analytics_async.html" . }} diff --git a/layouts/shortcodes/codepen.rss.html b/layouts/shortcodes/codepen.rss.html index 7f8b979a..ab05637e 100644 --- a/layouts/shortcodes/codepen.rss.html +++ b/layouts/shortcodes/codepen.rss.html @@ -1 +1 @@ -

Open this CodePen in a new window.

+

Open this CodePen in a new window.

diff --git a/layouts/shortcodes/facebook.amp.html b/layouts/shortcodes/facebook.amp.html new file mode 100644 index 00000000..22eb20ab --- /dev/null +++ b/layouts/shortcodes/facebook.amp.html @@ -0,0 +1,6 @@ + + diff --git a/layouts/shortcodes/facebook.html b/layouts/shortcodes/facebook.html new file mode 100644 index 00000000..d2cb10f6 --- /dev/null +++ b/layouts/shortcodes/facebook.html @@ -0,0 +1,3 @@ +{{- $url := printf "https://www.facebook.com/plugins/post/oembed.json/?omitscript=1&url=%s" (.Get "url" | urlize) -}} +{{- $json := getJSON $url -}} +{{- $json.html | safeHTML -}} diff --git a/layouts/shortcodes/facebook.rss.html b/layouts/shortcodes/facebook.rss.html new file mode 120000 index 00000000..a315199f --- /dev/null +++ b/layouts/shortcodes/facebook.rss.html @@ -0,0 +1 @@ +facebook.html \ No newline at end of file diff --git a/layouts/shortcodes/gh-buttons.html b/layouts/shortcodes/gh-buttons.html index ad2be2f7..ec58f345 100644 --- a/layouts/shortcodes/gh-buttons.html +++ b/layouts/shortcodes/gh-buttons.html @@ -1,5 +1,4 @@

Star    - Issue + Issue

- diff --git a/layouts/shortcodes/tweet.html b/layouts/shortcodes/tweet.html new file mode 100644 index 00000000..19b5b00c --- /dev/null +++ b/layouts/shortcodes/tweet.html @@ -0,0 +1,5 @@ +{{- /* Modified from tpl/tplimpl/embedded/templates/shortcodes/twitter.html, minus script */ -}} + +{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%v&dnt=1&omit_script=1" (index .Params 0) -}} +{{- $json := getJSON $url -}} +{{- $json.html | safeHTML -}} diff --git a/layouts/shortcodes/tweet.rss.html b/layouts/shortcodes/tweet.rss.html deleted file mode 100644 index dad22e6e..00000000 --- a/layouts/shortcodes/tweet.rss.html +++ /dev/null @@ -1,5 +0,0 @@ -{{- /* Modified from /tpl/tplimpl/embedded/templates/shortcodes/twitter.html to fetch tweet without script (&omit_script=1) */ -}} - -{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%d&omit_script=true" (index .Params 0) -}} -{{- $json := getJSON $url -}} -{{- $json.html | safeHTML -}} diff --git a/layouts/shortcodes/tweet.rss.html b/layouts/shortcodes/tweet.rss.html new file mode 120000 index 00000000..1fe77a50 --- /dev/null +++ b/layouts/shortcodes/tweet.rss.html @@ -0,0 +1 @@ +tweet.html \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 3054420a..8274f94f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -98,9 +98,3 @@ to = "/403.html" status = 403 force = true -# no clue what these requests are? but there are a lot... -[[redirects]] - from = "/plus/*.php" - to = "/403.html" - status = 403 - force = true