From b2a8b775e04bf21ec110638efe70f57323cd3dd5 Mon Sep 17 00:00:00 2001 From: tdro Date: Wed, 11 Jan 2023 22:26:12 -0500 Subject: themes/default/layouts/shortcodes/tweet: Replace with link This embed has to be strangest I've ever looked at.. use a simple link card. Could use https://publish.twitter.com/oembed but that's annoying.. --- assets/css/default.css | 46 +++++++++++++++++++++------- config.json | 7 ++--- config.toml | 6 ++-- config.yaml | 8 ++--- content/canory/messages/links.md | 11 +++++++ content/canory/messages/twitter.md | 11 ------- themes/default/layouts/shortcodes/link.html | 28 +++++++++++++++++ themes/default/layouts/shortcodes/tweet.html | 18 ----------- 8 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 content/canory/messages/links.md delete mode 100644 content/canory/messages/twitter.md create mode 100644 themes/default/layouts/shortcodes/link.html delete mode 100644 themes/default/layouts/shortcodes/tweet.html diff --git a/assets/css/default.css b/assets/css/default.css index e83e4b7..ad35758 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -1831,17 +1831,6 @@ diagram-container svg { background-color: var(--background); } -twitter-tweet { - min-height: 20rem; - max-height: 20rem; - display: block; - overflow-y: auto; -} - -twitter-tweet iframe { - border: none; -} - reaction-tip { text-decoration: underline; -webkit-text-decoration-style: wavy; @@ -1881,6 +1870,41 @@ main micro-card:first-of-type reaction-tip img { top: 100%; } +link-card { + display: flex; + border: 1px solid; + border-color: #ccc; + border-color: var(--border-darker); + border-radius: 0.5rem; + margin-bottom: 0.75rem; +} + +link-card a img { + min-width: 5rem; + max-width: 5rem; + padding: 1rem; + border: none; +} + +link-card > a { + border-right: 1px solid; + border-color: #ccc; + border-color: var(--border-darker); + display: flex; + align-items: center; + padding: 0.5rem; +} + +link-card article { + padding: 1rem; + width: 100%; +} + +link-card article a { + word-break: break-all; + display: block; +} + /* ----- Attributes ----- */ [tabindex="-1"]:focus { diff --git a/config.json b/config.json index 369ea15..b62e983 100644 --- a/config.json +++ b/config.json @@ -131,7 +131,6 @@ "frame-src": [ "'self'", "www.youtube-nocookie.com", - "platform.twitter.com", "en.m.wikipedia.org", "odysee.com", "www.gutenberg.org" @@ -155,12 +154,10 @@ "'self'" ], "script-src-elem": [ - "'self'", - "platform.twitter.com" + "'self'" ], "script-src": [ - "'self'", - "platform.twitter.com" + "'self'" ], "style-src": [ "'self'", diff --git a/config.toml b/config.toml index 1e93e57..e784b3e 100644 --- a/config.toml +++ b/config.toml @@ -108,14 +108,14 @@ enableRobotsTXT = true default-src = ["'self'"] font-src = ["'self'"] form-action = ["'self'", "lite.duckduckgo.com"] - frame-src = ["'self'", "www.youtube-nocookie.com", "platform.twitter.com", "en.m.wikipedia.org", "odysee.com", "www.gutenberg.org"] + frame-src = ["'self'", "www.youtube-nocookie.com", "en.m.wikipedia.org", "odysee.com", "www.gutenberg.org"] img-src = ["'self'", "http://preview.test", "www.gutenberg.org"] manifest-src = ["'self'"] media-src = ["'self'"] object-src = ["'self'", "www.gutenberg.org"] prefetch-src = ["'self'"] - script-src-elem = ["'self'", "platform.twitter.com"] - script-src = ["'self'", "platform.twitter.com"] + script-src-elem = ["'self'"] + script-src = ["'self'"] style-src = ["'self'", "'unsafe-inline'", "http://preview.test"] worker-src = ["'self'"] diff --git a/config.yaml b/config.yaml index 452f1d0..5f5c899 100644 --- a/config.yaml +++ b/config.yaml @@ -96,15 +96,15 @@ params: default-src: ["'self'"] font-src: ["'self'"] form-action: ["'self'", lite.duckduckgo.com] - frame-src: ["'self'", www.youtube-nocookie.com, platform.twitter.com, en.m.wikipedia.org, - odysee.com, www.gutenberg.org] + frame-src: ["'self'", www.youtube-nocookie.com, en.m.wikipedia.org, odysee.com, + www.gutenberg.org] img-src: ["'self'", http://preview.test, www.gutenberg.org] manifest-src: ["'self'"] media-src: ["'self'"] object-src: ["'self'", www.gutenberg.org] prefetch-src: ["'self'"] - script-src-elem: ["'self'", platform.twitter.com] - script-src: ["'self'", platform.twitter.com] + script-src-elem: ["'self'"] + script-src: ["'self'"] style-src: ["'self'", "'unsafe-inline'", http://preview.test] worker-src: ["'self'"] search: diff --git a/content/canory/messages/links.md b/content/canory/messages/links.md new file mode 100644 index 0000000..70e637b --- /dev/null +++ b/content/canory/messages/links.md @@ -0,0 +1,11 @@ ++++ +date = "2022-03-15T03:45:51+00:00" +lastmod = "2022-03-15T03:45:51+00:00" +tags = [ "docs", "links" ] +author = "canory" ++++ + +This individual is old enough to remember that the Internet is +a vast place. + +{{< link "https://web.archive.org/web/20200111092601/https://twitter.com/tveastman/status/1069674780826071040" >}} diff --git a/content/canory/messages/twitter.md b/content/canory/messages/twitter.md deleted file mode 100644 index 945a18d..0000000 --- a/content/canory/messages/twitter.md +++ /dev/null @@ -1,11 +0,0 @@ -+++ -date = "2022-03-15T03:45:51+00:00" -lastmod = "2022-03-15T03:45:51+00:00" -tags = [ "docs", "twitter" ] -author = "canory" -+++ - -This individual is old enough to remember that the Internet is -a vast place. - -{{< tweet tveastman 1069674780826071040 >}} diff --git a/themes/default/layouts/shortcodes/link.html b/themes/default/layouts/shortcodes/link.html new file mode 100644 index 0000000..4b9b7a6 --- /dev/null +++ b/themes/default/layouts/shortcodes/link.html @@ -0,0 +1,28 @@ +{{- $source := default "https://example.com/" (.Get "source" | default (.Get 0)) -}} + +{{- $host := $source -}} + +{{- with (urls.Parse $source).Host -}} + {{- $host = . -}} +{{- end -}} + +{{- $favicon := partial "function-favicon-domain.html" $host -}} + +{{- $image := partial "function-fetch-favicons.html" + (dict + "Source" $favicon + "Infix" ($host | anchorize) + ) +-}} + + + + {{ $host }} + + + diff --git a/themes/default/layouts/shortcodes/tweet.html b/themes/default/layouts/shortcodes/tweet.html deleted file mode 100644 index 759104b..0000000 --- a/themes/default/layouts/shortcodes/tweet.html +++ /dev/null @@ -1,18 +0,0 @@ -{{- $user := default "jack" (.Get "user" | default (.Get 0)) -}} -{{- $status := default "20" (.Get "status" | default (.Get 1)) -}} -{{- $caption := default "Twitter Tweet" (.Get "caption" | default (.Get 2)) -}} - - - - - - - -- cgit v1.2.3