Add per-page SEO tags, share image, sitemap and robots.txt #4
Loading…
Reference in a new issue
No description provided.
Delete branch "cc-8-seo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Each page now has its own title, description, canonical URL and Open Graph/Twitter tags with a 1200x630 share image (
src/og.png). The build also writessitemap.xmlandrobots.txt.Pages declare
<!-- title: ... -->and<!-- description: ... -->after<html>; the build strips them and fails if either is missing. Spec pages use the node'snameandblurb.The domain is a placeholder,
https://campercan.example, insrc/site.json. It needs the real one before launch.Tested:
node --testpasses (4 tests, one new).Ticket: CC-8
Two things to act on.
test/build.test.js: the test only checks og:image, titles and sitemap. Dropping the canonical link, og:url, the twitter tags or the description meta would still pass. It also never covers escaping (the hub blurb has a
", so assert"in spec/hub.html), robots.txt, or the .xml/.txt types in server.js. Add a few cheap assertions for canonical, description and robots.txt.src/site.json: the origin is the placeholder
https://campercan.example. Canonical, og:url, the sitemap and robots.txt will all point at it if this ships as is. Set the real domain before merge, or confirm it's deliberate.Minor:
escapeHtmlin build.js skips>. It's harmless inside attributes, but it is incomplete.