This guide explains how to manage redirects for your Jekyll-generated event pages to prevent broken links when titles change.
- Stable URLs: Event pages are now generated using stable
slugfields instead of titles - Automatic Redirects: When you change a title, add the old URL to
redirect_fromarray - SEO-Friendly: Redirects use proper HTTP redirects and canonical URLs
The setup includes:
- Modified
_config.yml: Usesslugfield for URL generation - Custom Plugin:
_plugins/datapage_redirect_generator.rbhandles redirects - Redirect Layout:
_layouts/redirect.htmlcreates proper redirect pages
Run the management script to ensure all events have stable slugs:
ruby manage_redirects.rbWhen changing a title, follow this pattern in _data/events.yml:
- id: 34
title: "New Updated Title" # New title
slug: "stable-slug-name" # Keep this the same!
redirect_from: # Add old URLs here
- "/events/meetup/old-title-slug"
- "/events/meetup/another-old-url"
# ... rest of event databundle exec jekyll buildOriginal Event:
- id: 34
title: "Beyond k8s and OpenSource Metrics"
slug: "beyond-k8s-and-opensource-metrics"URL: /events/meetup/beyond-k8s-and-opensource-metrics/
After Title Change:
- id: 34
title: "Advanced Kubernetes and Metrics" # New title
slug: "beyond-k8s-and-opensource-metrics" # Same slug = same URL
redirect_from:
- "/events/meetup/34-cloud-native-computing-linz-meetup" # Old URL still works- No Broken Links: Old URLs automatically redirect to new ones
- SEO Preserved: Search engines follow redirects properly
- User-Friendly: Visitors never see 404 errors
- Future-Proof: Easy to add more redirects as needed
- Build the site:
bundle exec jekyll build - Serve locally:
bundle exec jekyll serve - Test old URLs in browser to confirm redirects work
- Check that new URLs display the correct content
- Keep slugs stable once created
- Always add old URLs to
redirect_fromwhen changing titles - Run
ruby manage_redirects.rbto ensure all events have slugs - Regularly test redirects after deployments