From 934a9f233870a990a63904e2a46c39ee2e596cbd Mon Sep 17 00:00:00 2001 From: Adrian Altner Date: Tue, 21 Apr 2026 23:46:18 +0200 Subject: [PATCH] Implement Webmention functionality: add Webmentions component, update deploy script, and enhance UI with social links and localization --- scripts/deploy.sh | 2 +- src/components/BaseHead.astro | 4 + src/components/Footer.astro | 39 +++++ src/components/FormattedDate.astro | 9 +- src/components/Webmentions.astro | 247 +++++++++++++++++++++++++++++ src/i18n/ui.ts | 14 ++ src/layouts/Post.astro | 29 +++- src/lib/webmentions.ts | 126 +++++++++++++++ 8 files changed, 460 insertions(+), 10 deletions(-) create mode 100644 src/components/Webmentions.astro create mode 100644 src/lib/webmentions.ts diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 464f031..c220008 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -39,7 +39,7 @@ echo "Deploy done via $VPS (branch: $REMOTE_BRANCH)." WEBMENTION_APP_TOKEN="$(ssh "$VPS" "grep '^WEBMENTION_APP_TOKEN=' '$REMOTE_BASE/.env.production' | cut -d= -f2-" 2>/dev/null || true)" if [[ -n "$WEBMENTION_APP_TOKEN" ]]; then echo "Sending webmentions via webmention.app..." - for feed in rss/blog.xml rss/fotos.xml; do + for feed in rss.xml en/rss.xml; do curl -s -X POST "https://webmention.app/check?url=https://adrian-altner.de/${feed}&token=${WEBMENTION_APP_TOKEN}" \ | grep -o '"status":"[^"]*"' || true done diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 14260c0..07a4e18 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -45,6 +45,10 @@ const rssHref = new URL(locale === 'de' ? 'rss.xml' : 'en/rss.xml', Astro.site); + + + + {title} diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 7a87348..ec7a5f0 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -17,6 +17,31 @@ const today = new Date();