From fdcb7310d373977524efce3d394d653bf4f3ac1b Mon Sep 17 00:00:00 2001 From: Oliver Turner Date: Wed, 15 Dec 2021 23:07:57 +0000 Subject: [PATCH 1/2] Add sharing links --- src/components/post-content.astro | 2 + src/components/share-links.astro | 156 ++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 src/components/share-links.astro diff --git a/src/components/post-content.astro b/src/components/post-content.astro index 3a2463b..3980c73 100644 --- a/src/components/post-content.astro +++ b/src/components/post-content.astro @@ -12,6 +12,7 @@ export interface Props { } import dateFormat from "dateformat"; +import ShareLinks from "$components/share-links.astro"; const { title, publishDate: publishDateRaw, permalink, image } = Astro.props; @@ -41,6 +42,7 @@ const publishDate = dateFormat(publishDateRaw, "dS mmm, yyyy");
+
diff --git a/src/components/share-links.astro b/src/components/share-links.astro new file mode 100644 index 0000000..156ecf4 --- /dev/null +++ b/src/components/share-links.astro @@ -0,0 +1,156 @@ +--- +const { title, permalink } = Astro.props; +const links = { + email: `mailto:?subject=${title}&body=${permalink}`, + twitter: `https://twitter.com/intent/tweet/?text=${title}&url=${permalink}`, + linkedin: `https://www.linkedin.com/shareArticle?mini=true&url=${permalink}&title=${title}&summary=${title}&source=${permalink}`, +}; +--- + + + + + From e9e4636a671413bd1d54f8a2be579f32fa5a6447 Mon Sep 17 00:00:00 2001 From: Oliver Turner Date: Thu, 16 Dec 2021 00:00:35 +0000 Subject: [PATCH 2/2] reponsive tweaks --- src/components/share-links.astro | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/share-links.astro b/src/components/share-links.astro index 156ecf4..977da0f 100644 --- a/src/components/share-links.astro +++ b/src/components/share-links.astro @@ -66,22 +66,27 @@ const links = { -