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..977da0f --- /dev/null +++ b/src/components/share-links.astro @@ -0,0 +1,165 @@ +--- +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}`, +}; +--- + + + + +