diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2026-03-03 01:32:16 +0100 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2026-03-03 01:32:16 +0100 |
| commit | 42edb9a443cc9ea1bf6fe833ee46953a5a3da5f8 (patch) | |
| tree | 6d45e85275860ae140b640a426147a9d0da556fb /src | |
| parent | 0e11aca148c7049c3a5ac9106fc7622ce6d90e6a (diff) | |
Add Mastodon sharing feature and update footer with Mastodon badge
Squashed commit of the following:
commit 87102bff5e03d689debd14aa91a86074b714cc2f
Author: Ariel Costas Guerrero <ariel@costas.dev>
Date: Tue Mar 3 01:30:20 2026 +0100
Improve sharing message
commit c04a63ebaaea645460780176c6ab6e3783f00362
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Tue Mar 3 00:01:00 2026 +0000
feat: add Mastodon integration (profile badge, share button, fediverse:creator meta tag)
Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com>
commit d2630b4d4ebee0493bfae117d21ce4a2fe78ffaf
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date: Mon Mar 2 23:56:42 2026 +0000
Initial plan
Diffstat (limited to 'src')
| -rw-r--r-- | src/layouts/BlogSingleLayout.astro | 6 | ||||
| -rw-r--r-- | src/layouts/Layout.astro | 2 | ||||
| -rw-r--r-- | src/partials/Footer.astro | 11 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/layouts/BlogSingleLayout.astro b/src/layouts/BlogSingleLayout.astro index 70b62c2..d3396ec 100644 --- a/src/layouts/BlogSingleLayout.astro +++ b/src/layouts/BlogSingleLayout.astro @@ -47,6 +47,10 @@ const schema = { }, }, }; + +const textToEncode = `${entry.data.title}\r\n\r\n${Astro.url.toString()} por @arielcg@mastodon.social`; + +const mastodonShareUrl = `https://share.joinmastodon.org/#text=${encodeURIComponent(textToEncode)}`; --- <Layout title={entry.data.title} description={entry.data.description}> @@ -79,6 +83,8 @@ const schema = { <p> <a href="/blog/">Volver al blog</a> + ยท + <a href={mastodonShareUrl} rel="noopener noreferrer">Compartir en Mastodon</a> </p> </Layout> diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index f484ce8..ebe5917 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -42,6 +42,8 @@ const { title, description, empty } = Astro.props; <meta name="twitter:description" content={description} /> <meta name="twitter:image" content="/favicon.png" /> + <meta name="fediverse:creator" content="@arielcg@mastodon.social" /> + <title>{title} - Ariel Costas</title> <slot name="head-jsonld" /> diff --git a/src/partials/Footer.astro b/src/partials/Footer.astro index 710006a..4a5cb99 100644 --- a/src/partials/Footer.astro +++ b/src/partials/Footer.astro @@ -32,6 +32,12 @@ import t from "../i18n/es.json"; href="https://github.com/arielcostas/costasdev" >BY-SA 4.0</a > + </article> + + <article id="footer-badge-mastodon"> + <Icon name="tabler:brand-mastodon" /> + <a href="https://mastodon.social/@arielcg" rel="me noopener noreferrer">@arielcg</a> + </article> </section> </footer> @@ -109,5 +115,10 @@ import t from "../i18n/es.json"; background: linear-gradient(to bottom, #333, #000); color: white; } + + #footer-badge-mastodon { + background: linear-gradient(to bottom, #6364ff, #563acc); + color: white; + } } </style> |
