aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2023-01-11 22:26:12 -0500
committertdro <tdro@noreply.example.com>2023-01-11 22:57:34 -0500
commitb2a8b775e04bf21ec110638efe70f57323cd3dd5 (patch)
treeec27cc632da89b94e1a644d25ee1a7668e1db23a
parentfbf36e364b6442ca82eee39b5a86743dcab282ef (diff)
downloadcanory-b2a8b775e04bf21ec110638efe70f57323cd3dd5.tar.gz
canory-b2a8b775e04bf21ec110638efe70f57323cd3dd5.tar.bz2
canory-b2a8b775e04bf21ec110638efe70f57323cd3dd5.zip
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..
-rw-r--r--assets/css/default.css46
-rw-r--r--config.json7
-rw-r--r--config.toml6
-rw-r--r--config.yaml8
-rw-r--r--content/canory/messages/links.md (renamed from content/canory/messages/twitter.md)4
-rw-r--r--themes/default/layouts/shortcodes/link.html28
-rw-r--r--themes/default/layouts/shortcodes/tweet.html18
7 files changed, 74 insertions, 43 deletions
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/twitter.md b/content/canory/messages/links.md
index 945a18d..70e637b 100644
--- a/content/canory/messages/twitter.md
+++ b/content/canory/messages/links.md
@@ -1,11 +1,11 @@
+++
date = "2022-03-15T03:45:51+00:00"
lastmod = "2022-03-15T03:45:51+00:00"
-tags = [ "docs", "twitter" ]
+tags = [ "docs", "links" ]
author = "canory"
+++
This individual is old enough to remember that the Internet is
a vast place.
-{{< tweet tveastman 1069674780826071040 >}}
+{{< link "https://web.archive.org/web/20200111092601/https://twitter.com/tveastman/status/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)
+ )
+-}}
+
+<link-card>
+ <a href="{{ $source }}">
+ <img alt="{{ $host }}" src="{{ $image.Permalink }}" />
+ </a>
+ <article>
+ <h2>{{ $host }}</h2>
+ <a href="{{ $source }}">
+ {{ $source }}
+ </a>
+ </article>
+</link-card>
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)) -}}
-
-<twitter-tweet>
- <blockquote class="twitter-tweet">
- <a href="https://twitter.com/{{ $user }}/status/{{ $status }}">
- https://twitter.com/{{ $user }}/status/{{ $status }}
- </a>
- </blockquote>
- <script
- async
- src="https://platform.twitter.com/widgets.js"
- >
- </script>
-</twitter-tweet>
-
-<footer>{{ $caption }}</footer>