Sitemap Fix is a Publii plugin that repairs sitemap.xml
when your site uses a posts URL prefix (e.g. /content/). Without it, prefixed posts lose
their <lastmod> dates and <image:image> entries because of a slug lookup mismatch in
Publii's core sitemap generator, reported as GetPublii/Publii#2556.
That core issue has since been resolved in v0.47.6, but this plugin remains useful even on current Publii because it adds <lastmod> to tag/category pages and the homepage which is yet not implemented
- Restore
<lastmod>and<image:image>entries for posts that use a URL prefix - Add
<lastmod>to tag/category pages, based on the most recently modified post in each tag - Add
<lastmod>to the homepage when a page is set as the frontpage - Reads post/tag URLs from your site's URL settings (posts prefix, tags prefix), no hardcoded paths
- Extracts images from featured images and the HTML, block, and markdown editors
Publii 0.43.0 or newer.
- Download the release ZIP.
- Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
- Enable the plugin for the site.
No configuration needed, enable it and rebuild your site. The plugin runs after Publii
generates the sitemap and rewrites sitemap.xml in place with the corrected entries.
Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.
This project is licensed under the GPLv3+. See LICENSE file for details.
None. The plugin class (main.js) is self-contained plain JavaScript with no dependencies.
This project was developed by InPoint Automation Sp. z o.o. https://inpointautomation.com/
Thanks to the Publii project for the CMS and plugin API.
See CHANGELOG.md for the full version history.