diff --git a/.percy.yml b/.percy.yml index 7e088845..dedc1be2 100644 --- a/.percy.yml +++ b/.percy.yml @@ -5,7 +5,7 @@ snapshot: - 1050 enable-javascript: true percy-css: > - div.embed, + .embed, iframe, video, img[src$=".gif"], diff --git a/assets/sass/components/_embeds.scss b/assets/sass/components/_embeds.scss index ae3fd28f..0135050d 100644 --- a/assets/sass/components/_embeds.scss +++ b/assets/sass/components/_embeds.scss @@ -1,5 +1,5 @@ // External social embeds -div.embed { +.embed { &.codepen { iframe { width: 100%; @@ -8,8 +8,10 @@ div.embed { } &.tweet { - .twitter-tweet-rendered iframe { - margin: 0.5em 0; + margin: 0.5em 0; + + > .twitter-tweet-rendered { + margin: 0 auto; } } @@ -40,12 +42,25 @@ div.embed { } } + &.vimeo { + padding: 75% 0 0 0; + position: relative; + + iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + } + &.gh-buttons { text-align: center; // GitHub's script replaces with , so cover both - > span, - > a { + > a, + > span { margin: 0 0.5em; } } diff --git a/layouts/shortcodes/iframe.html b/layouts/shortcodes/iframe.html index 9ca2d2ec..2e06c614 100644 --- a/layouts/shortcodes/iframe.html +++ b/layouts/shortcodes/iframe.html @@ -1,3 +1,11 @@
- +
diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index 129bd40b..d99c9ee7 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -6,9 +6,11 @@ {{- with .Inner }} alt="{{ . | $.Page.RenderString | plainify | safeHTML }}" {{- else }} - {{ with .Get "alt" }} alt="{{ . | safeHTML }}"{{ end }} + {{ with .Get "alt" }} + alt="{{ . | safeHTML }}" + {{ end }} {{- end -}} - > + /> {{ if .Get "link" }}
{{ end }} {{ with .Inner -}} diff --git a/layouts/shortcodes/image.rss.xml b/layouts/shortcodes/image.rss.xml index b55e8701..dfe60b0c 100644 --- a/layouts/shortcodes/image.rss.xml +++ b/layouts/shortcodes/image.rss.xml @@ -1,10 +1,17 @@ {{- $optimized := partial "functions/optimize-image" . -}}

-{{ with .Get "link" }}{{ end }} -{{ . | safeHTML }} -{{ if .Get "link" }}{{ end }} -{{ with .Inner }}
{{ . | $.Page.RenderString | safeHTML }}{{ end -}} + {{ with .Get "link" }}{{ end }} + {{ . | $.Page.RenderString | plainify | safeHTML }} + {{ if .Get "link" }}{{ end }} + + {{ with .Inner }}
{{ . | $.Page.RenderString | safeHTML }}{{ end -}}

diff --git a/layouts/shortcodes/instagram.html b/layouts/shortcodes/instagram.html index 1751138e..252a29e8 100644 --- a/layouts/shortcodes/instagram.html +++ b/layouts/shortcodes/instagram.html @@ -6,5 +6,5 @@ {{- define "__shortcode_instagram_js" }} - + {{- end }} diff --git a/layouts/shortcodes/tweet.html b/layouts/shortcodes/tweet.html index 8e0aaabd..ad0e5c49 100644 --- a/layouts/shortcodes/tweet.html +++ b/layouts/shortcodes/tweet.html @@ -1,4 +1,4 @@ -{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&align=center&url=%s" (index .Params 0 | safeURL) -}} +{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&url=%s" (index .Params 0 | safeURL) -}} {{- $json := getJSON $url -}}
diff --git a/layouts/shortcodes/tweet.rss.xml b/layouts/shortcodes/tweet.rss.xml index 15acdab0..e7e6a306 100644 --- a/layouts/shortcodes/tweet.rss.xml +++ b/layouts/shortcodes/tweet.rss.xml @@ -1,4 +1,4 @@ -{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&align=center&url=%s" (index .Params 0 | safeURL) -}} +{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&url=%s" (index .Params 0 | safeURL) -}} {{- $json := getJSON $url -}} {{ $json.html | safeHTML }} diff --git a/layouts/shortcodes/vimeo.html b/layouts/shortcodes/vimeo.html index 4d8467e3..162b68d7 100644 --- a/layouts/shortcodes/vimeo.html +++ b/layouts/shortcodes/vimeo.html @@ -1,7 +1,12 @@ -
- +
+
{{- define "__shortcode_vimeo_js" }} - + {{ end }} diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html index db3db352..8d888902 100644 --- a/layouts/shortcodes/youtube.html +++ b/layouts/shortcodes/youtube.html @@ -2,6 +2,7 @@
diff --git a/resources/_gen/getjson/66253b5f9b7458cc40f01f1e4dec5b54 b/resources/_gen/getjson/66253b5f9b7458cc40f01f1e4dec5b54 new file mode 100644 index 00000000..951fc77c --- /dev/null +++ b/resources/_gen/getjson/66253b5f9b7458cc40f01f1e4dec5b54 @@ -0,0 +1 @@ +{"url":"https:\/\/twitter.com\/archiveis\/status\/1018691421182791680","author_name":"archive.today","author_url":"https:\/\/twitter.com\/archiveis","html":"\u003Cblockquote class=\"twitter-tweet\" data-lang=\"en\" data-dnt=\"true\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003E"Having to do" is not so direct here.\u003Cbr\u003EAbsence of EDNS and massive mismatch (not only on AS\/Country, but even on the continent level) of where DNS and related HTTP requests come from causes so many troubles so I consider EDNS-less requests from Cloudflare as invalid.\u003C\/p\u003E— archive.today (@archiveis) \u003Ca href=\"https:\/\/twitter.com\/archiveis\/status\/1018691421182791680?ref_src=twsrc%5Etfw\"\u003EJuly 16, 2018\u003C\/a\u003E\u003C\/blockquote\u003E\n","width":550,"height":null,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","version":"1.0"} \ No newline at end of file diff --git a/resources/_gen/getjson/6a1f75720293575d6406621061cdf3a1 b/resources/_gen/getjson/6a1f75720293575d6406621061cdf3a1 new file mode 100644 index 00000000..e1e850a3 --- /dev/null +++ b/resources/_gen/getjson/6a1f75720293575d6406621061cdf3a1 @@ -0,0 +1 @@ +{"url":"https:\/\/twitter.com\/sandofsky\/status\/1138686582859239425","author_name":"Ben Sandofsky","author_url":"https:\/\/twitter.com\/sandofsky","html":"\u003Cblockquote class=\"twitter-tweet\" data-lang=\"en\" data-dnt=\"true\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003EDropbox now uses over half a gig of memory. Let’s peak into its frameworks folder. \u003Ca href=\"https:\/\/t.co\/altzzc2q8L\"\u003Epic.twitter.com\/altzzc2q8L\u003C\/a\u003E\u003C\/p\u003E— Ben Sandofsky (@sandofsky) \u003Ca href=\"https:\/\/twitter.com\/sandofsky\/status\/1138686582859239425?ref_src=twsrc%5Etfw\"\u003EJune 12, 2019\u003C\/a\u003E\u003C\/blockquote\u003E\n","width":550,"height":null,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","version":"1.0"} \ No newline at end of file diff --git a/resources/_gen/getjson/954c649ddc7e7df8e60b773d80d62c8d b/resources/_gen/getjson/954c649ddc7e7df8e60b773d80d62c8d new file mode 100644 index 00000000..267a88ff --- /dev/null +++ b/resources/_gen/getjson/954c649ddc7e7df8e60b773d80d62c8d @@ -0,0 +1 @@ +{"url":"https:\/\/twitter.com\/natfriedman\/status\/1271253144442253312","author_name":"Nat Friedman","author_url":"https:\/\/twitter.com\/natfriedman","html":"\u003Cblockquote class=\"twitter-tweet\" data-lang=\"en\" data-dnt=\"true\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003EIt's a great idea and we are already working on this! cc \u003Ca href=\"https:\/\/twitter.com\/billygriffin22?ref_src=twsrc%5Etfw\"\u003E@billygriffin22\u003C\/a\u003E\u003C\/p\u003E— Nat Friedman (@natfriedman) \u003Ca href=\"https:\/\/twitter.com\/natfriedman\/status\/1271253144442253312?ref_src=twsrc%5Etfw\"\u003EJune 12, 2020\u003C\/a\u003E\u003C\/blockquote\u003E\n","width":550,"height":null,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","version":"1.0"} \ No newline at end of file diff --git a/resources/_gen/getjson/f1d0987a50faef9d3f14ed3d2359d95e b/resources/_gen/getjson/f1d0987a50faef9d3f14ed3d2359d95e new file mode 100644 index 00000000..c89f7763 --- /dev/null +++ b/resources/_gen/getjson/f1d0987a50faef9d3f14ed3d2359d95e @@ -0,0 +1 @@ +{"url":"https:\/\/twitter.com\/w3Nicolas\/status\/1134529316904153089","author_name":"Nicolas Beauvais","author_url":"https:\/\/twitter.com\/w3Nicolas","html":"\u003Cblockquote class=\"twitter-tweet\" data-lang=\"en\" data-dnt=\"true\"\u003E\u003Cp lang=\"en\" dir=\"ltr\"\u003EHow \u003Ca href=\"https:\/\/twitter.com\/digitalocean?ref_src=twsrc%5Etfw\"\u003E@DigitalOcean\u003C\/a\u003E just killed our company \u003Ca href=\"https:\/\/twitter.com\/raisupcom?ref_src=twsrc%5Etfw\"\u003E@raisupcom\u003C\/a\u003E. A long thread for a very sad story. \u003Ca href=\"https:\/\/t.co\/uOFCDRoYJ6\"\u003Epic.twitter.com\/uOFCDRoYJ6\u003C\/a\u003E\u003C\/p\u003E— Nicolas Beauvais (@w3Nicolas) \u003Ca href=\"https:\/\/twitter.com\/w3Nicolas\/status\/1134529316904153089?ref_src=twsrc%5Etfw\"\u003EMay 31, 2019\u003C\/a\u003E\u003C\/blockquote\u003E\n","width":550,"height":null,"type":"rich","cache_age":"3153600000","provider_name":"Twitter","provider_url":"https:\/\/twitter.com","version":"1.0"} \ No newline at end of file diff --git a/vercel.json b/vercel.json index ed7c9323..880fb8d0 100755 --- a/vercel.json +++ b/vercel.json @@ -8,10 +8,7 @@ { "source": "/favicon.ico", "destination": "/assets/images/favicon.ico" }, { "source": "/favicon.png", "destination": "/assets/images/favicon-64.png" }, { "source": "/apple-touch-icon.png", "destination": "/assets/images/apple-touch-icon.png" }, - { - "source": "/apple-touch-icon-precomposed.png", - "destination": "/assets/images/apple-touch-icon.png" - } + { "source": "/apple-touch-icon-precomposed.png", "destination": "/assets/images/apple-touch-icon.png" } ], "redirects": [ { "source": "/notes/:slug/amp.html", "destination": "/notes/:slug/", "statusCode": 301 },