Skip to content

feat(seo): add sitemap.xml, robots.txt presets, and OpenGraph meta tags#157

Closed
NTBBloodbath wants to merge 5 commits into
masterfrom
push-tuzxqzkmywqn
Closed

feat(seo): add sitemap.xml, robots.txt presets, and OpenGraph meta tags#157
NTBBloodbath wants to merge 5 commits into
masterfrom
push-tuzxqzkmywqn

Conversation

@NTBBloodbath

Copy link
Copy Markdown
Collaborator
  • 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 to all pages
  • Add scripts/update-robots-presets.sh to update no_llms preset from upstream

Resolves #64, #124

- 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
@NTBBloodbath NTBBloodbath marked this pull request as draft June 27, 2026 22:30
… 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
@NTBBloodbath NTBBloodbath marked this pull request as ready for review June 28, 2026 01:48
@NTBBloodbath

Copy link
Copy Markdown
Collaborator Author

Manually merged, closing this

@NTBBloodbath NTBBloodbath deleted the push-tuzxqzkmywqn branch June 30, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: SEO improvements

1 participant