diff --git a/layouts/shortcodes/codepen.rss.html b/layouts/shortcodes/codepen.rss.html deleted file mode 120000 index 6e5cd348..00000000 --- a/layouts/shortcodes/codepen.rss.html +++ /dev/null @@ -1 +0,0 @@ -codepen.html \ No newline at end of file diff --git a/layouts/shortcodes/codepen.rss.html b/layouts/shortcodes/codepen.rss.html new file mode 100644 index 00000000..7f8b979a --- /dev/null +++ b/layouts/shortcodes/codepen.rss.html @@ -0,0 +1 @@ +

Open this CodePen in a new window.

diff --git a/layouts/shortcodes/gh-buttons.rss.html b/layouts/shortcodes/gh-buttons.rss.html deleted file mode 120000 index 09ee6311..00000000 --- a/layouts/shortcodes/gh-buttons.rss.html +++ /dev/null @@ -1 +0,0 @@ -gh-buttons.html \ No newline at end of file diff --git a/layouts/shortcodes/gh-buttons.rss.html b/layouts/shortcodes/gh-buttons.rss.html new file mode 100644 index 00000000..dadfad22 --- /dev/null +++ b/layouts/shortcodes/gh-buttons.rss.html @@ -0,0 +1,4 @@ +

+ Star {{ .Get "username" }}/{{ .Get "repo" }} on GitHub    + Issues for {{ .Get "username" }}/{{ .Get "repo" }} on GitHub +

diff --git a/layouts/shortcodes/image.amp.html b/layouts/shortcodes/image.amp.html index 7dbbbada..0b787606 100644 --- a/layouts/shortcodes/image.amp.html +++ b/layouts/shortcodes/image.amp.html @@ -1,7 +1,8 @@ +{{- /* Automatic resizing for HiDPI/retina images */ -}} + {{- $original := .Page.Resources.GetMatch (.Get "src") -}} {{- .Scratch.Set "image" $original -}} - {{- $maxWidth := 910 -}} {{- $setWidth := 0 -}} diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index f15ec0da..c1320764 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -1,9 +1,8 @@ - +{{- /* Automatic resizing for HiDPI/retina images */ -}} {{- $original := .Page.Resources.GetMatch (.Get "src") -}} {{- .Scratch.Set "image" $original -}} - {{- $maxWidth := 910 -}} {{- $setWidth := 0 -}} diff --git a/layouts/shortcodes/image.rss.html b/layouts/shortcodes/image.rss.html deleted file mode 120000 index 231dcde4..00000000 --- a/layouts/shortcodes/image.rss.html +++ /dev/null @@ -1 +0,0 @@ -image.html \ No newline at end of file diff --git a/layouts/shortcodes/image.rss.html b/layouts/shortcodes/image.rss.html new file mode 100644 index 00000000..820a3b6a --- /dev/null +++ b/layouts/shortcodes/image.rss.html @@ -0,0 +1,35 @@ +{{- /* Automatic resizing for HiDPI/retina images */ -}} + +{{- $original := .Page.Resources.GetMatch (.Get "src") -}} +{{- .Scratch.Set "image" $original -}} + +{{- $maxWidth := 910 -}} +{{- $setWidth := 0 -}} + +{{- if .Get "width" -}} + {{- $setWidth = (int (.Get "width")) -}} + {{- $retinaWidth := (mul $setWidth 2) -}} + + {{- if gt $original.Width $retinaWidth -}} + {{- $finalWidth := (printf "%dx" $retinaWidth) -}} + {{- .Scratch.Set "image" ($original.Resize $finalWidth) -}} + {{- end -}} +{{- else -}} + {{- $setWidth = $maxWidth -}} + {{- if gt $original.Width 1820 -}} + {{- .Scratch.Set "image" ($original.Resize "1820x") -}} + {{- end -}} +{{- end -}} + +{{- $image := .Scratch.Get "image" -}} + +{{- $origRatio := (div (float $image.Height) $image.Width) -}} +{{- $displayWidth := $setWidth -}} +{{- $displayHeight := (math.Ceil (mul $origRatio $setWidth)) -}} + +

+{{ . }} +{{ with .Get "caption" }}
{{ . }}{{ end -}} +

diff --git a/layouts/shortcodes/tweet.rss.html b/layouts/shortcodes/tweet.rss.html new file mode 100644 index 00000000..dad22e6e --- /dev/null +++ b/layouts/shortcodes/tweet.rss.html @@ -0,0 +1,5 @@ +{{- /* 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/youtube.rss.html b/layouts/shortcodes/youtube.rss.html deleted file mode 120000 index a5581bc7..00000000 --- a/layouts/shortcodes/youtube.rss.html +++ /dev/null @@ -1 +0,0 @@ -youtube.html \ No newline at end of file diff --git a/layouts/shortcodes/youtube.rss.html b/layouts/shortcodes/youtube.rss.html new file mode 100644 index 00000000..e4292dd0 --- /dev/null +++ b/layouts/shortcodes/youtube.rss.html @@ -0,0 +1 @@ +

Watch this video on YouTube.