Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
KS-DB-Merge-ToolsPublic archive

About

Static site sitemap generator with lastmod based on content hash (not only on file date). Configure priority, changefreq, and include/exclude masks via json config. Auto-includes images with URL and title from alt text. Used to power sitemap for ksdbmerge.tools.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

content-hash-sitemap

A static site sitemap generator that sets lastmod based on content hash (not just file modification time). This script was created to update the page modification date in the sitemap only when the content actually changes. Many tools (in particular, Git clients) may alter file timestamps without changing the content, which would otherwise cause false updates in the sitemap.

Features

  • Configurable include/exclude file masks
  • Configurable changefreq and priority
  • URL aliasing — for example, mapping <loc>https://example.com/index.html</loc> to <loc>https://example.com/</loc>
  • Automatic generation of nested image:image elements with loc and title derived from the alt text

How to Use

  • Edit config.json: set the correct base_dir and domain. Review and adjust file masks and other settings according to your site's structure. By default, the file contains only example configurations.
  • Run sitemap_gen.py. It will generate sitemap.xml in the site directory and save file hashes in file_info.json (in the script's folder) for use in future incremental updates.
  • Run the script from the command line for the first time to catch any generation errors. Most common issues arise from JSON syntax errors in config.json after editing.

Notes

  • Tested only on Windows
  • Files with zero size are automatically excluded, even if they match the filter (this is used by ksdbmerge.tools to skip S3 redirects; and in general, indexing empty files is not recommended)
  • Images are only included if they appear after an H1 tag — this ensures only meaningful content images are added, excluding header icons and navigation elements.
  • Currently used to generate the sitemap for ksdbmerge.tools

Project Status

This tool fully covers the functionality it was designed for.
At the moment, no new features are planned, and we do not accept pull requests for extending its functionality.

If you need any fixes or additional features, feel free to fork the repository and adapt it to your needs.

About

Static site sitemap generator with lastmod based on content hash (not only on file date). Configure priority, changefreq, and include/exclude masks via json config. Auto-includes images with URL and title from alt text. Used to power sitemap for ksdbmerge.tools.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages