Similar to automating sending my WebSub requests, I also automated sending Webmention requests. So this also works via a separate stage in the CI pipeline on GitLab, but is slighly more involved. Because as opposed to the WebSub requests - which are just fire-and-forget - I need to find out what posts were added or updated and grab their URLs during the build/deploy step. Hereβs that section from my .gitlab-ci.yml: pages: stage: deploy before_script: *jekyll_before_script script: - bundle exec jekyll build -d public - find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\|atom\)$' -exec gzip -f -k {} \; - | touch webmention_urls.txt CHANGED_POSTS=$(git diff --name-only HEAD~1 HEAD -- _posts/ | grep '\.md$' || true) for FILE in $CHANGED_POSTS; do CUSTOM_SLUG=$(sed -n '/^---$/,/^---$/{ /^slug:/{ s/^slug:[[:space:]]*//; s/^["'"'"']//; s/["'"'"']$//; p; } }' "$FILE") if [ -n "$CUSTOM_SLUG" ]; then SLUG="$CUSTOM_SLUG" else SLUG=$(basename "$FILE" .md | sedβ¦
No comments yet. Log in to reply on the Fediverse. Comments will appear here.