pub-server package for generating robots.txt and sitemap.xml
npm install pub-pkg-seoThis pub-server package
provides a convenient way to generate sitemap.xml and robots.txt.
It can also inject a tag for robots and a canonical tag, via handlebars helper {{{metaSeo}}}.
- add pub-pkg-seo to your pub-config pkgs
The generated /robots.txt file will allow all pages unless noRobots:true is set in pub-config.
Layout templates should embed {{{metaSeo}}} in the HTML header.
This will also inject a unless noRobots:true
If opts.canonicalUrl is set to say https://jldec.me, the {{{metaSeo}} helper will include, appending the href for each page.
The generated /sitemap.xml will include fully qualified links to all generated pages
except those with metadata values nocrawl:true or nopublish:true.
sitemap links will be qualified with the opts.appUrl prefix (also settable via the APP environment variable.)