feat(seo): add sitemap.xml, robots.txt presets, and OpenGraph meta tags#157
Closed
NTBBloodbath wants to merge 5 commits into
Closed
feat(seo): add sitemap.xml, robots.txt presets, and OpenGraph meta tags#157NTBBloodbath wants to merge 5 commits into
NTBBloodbath wants to merge 5 commits into
Conversation
- Add [seo] and [robots] config sections to SiteConfig - Auto-generate sitemap.xml with all non-draft page URLs - Generate robots.txt with presets: allow_all, no_llms (ai.robots.txt), block_all - Support custom robots.txt file via custom_file field - Inject OpenGraph and Twitter Card meta tags in base templates - Add <link rel="canonical"> to all pages - Add scripts/update-robots-presets.sh to update no_llms preset from upstream Resolves #64, #124
… in sitemap
Previously sitemap.xml only contained content page permalinks, missing:
- Homepage (/) when no content/index.norg exists
- Category listing pages (/categories/ and /categories/{name}/)
- RSS/Atom feed URLs (/rss.xml etc.)
- lastmod dates from post metadata (updated/created)
Also modifies generate_xml_feeds() to return feed filenames so the
sitemap generator can include them
When no `image` field is present in a page's metadata, og:image and twitter:image now fall back to `config.seo.default_image`. This ensures social previews always have an image even on pages that don't set a per-page image
Documents sitemap, open_graph, default_image, and robots.txt preset options in docs/norgolith.toml
Tests cover: - Sitemap XML structure (empty, single/multiple URLs, lastmod) - Robots.txt presets (allow_all, block_all, no_llms) - Sitemap directive inclusion when enabled/disabled - Custom file fallback on missing file - Default behavior with no preset or custom file
Collaborator
Author
|
Manually merged, closing this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #64, #124