Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 2.11 KB

File metadata and controls

64 lines (40 loc) · 2.11 KB

Sitemap Fix

Icon

Description

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

Features

  • 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

Requirements

Publii 0.43.0 or newer.

Installation

  1. Download the release ZIP.
  2. Publii -> Tools -> Plugins -> Install plugin -> pick the ZIP.
  3. Enable the plugin for the site.

Usage

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.

Contributing

Feel free to fork this project or contribute a PR. Build instructions can be found in the developer readme DEV.md.

Licenses

Main code

This project is licensed under the GPLv3+. See LICENSE file for details.

Third-Party Components

None. The plugin class (main.js) is self-contained plain JavaScript with no dependencies.

Credits

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.

Changelog

See CHANGELOG.md for the full version history.