All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bumps cicirello/pyaction from 4.30.0 to 4.31.0.
- Escape characters that must be escaped in XML.
- Bump cicirello/pyaction from 4.26.0 to 4.30.0
- Ability to specify list of paths to exclude from sitemap, via new input
exclude-paths
.
- Bump cicirello/pyaction from 4.25.0 to 4.26.0
- Fix minor bug in regex used to detect if a page has a meta robots noindex directive in head.
- Bump Python to 3.12 in CI/CD workflows when running unit tests.
- Bump cicirello/pyaction from 4.14.1 to 4.25.0, including upgrading Python within the Docker container to 3.12.
- Case-insensitive check for
<meta name="robots" content="noindex">
in head of html files. - Correct handling of
<meta content="noindex" name="robots">
(i.e., content before name).
- Bump cicirello/pyaction from 4.12.0 to 4.14.1
- Option to include dates only in the lastmod fields of XML sitemaps. Default includes full date-time.
- Bump Python to 3.11 in CI/CD workflows.
- Bump cicirello/pyaction from 4.11.1 to 4.12.0, which includes upgrading Python in the Docker container to 3.11.0.
- Some users may be using the action on a self-hosted runner not yet updated to a version supporting the
new GitHub Actions
GITHUB_OUTPUT
environment file. This patch adds backwards compatibility for those users (e.g., it falls back to using the deprecatedset-output
ifGITHUB_OUTPUT
doesn't exist).
- Bump cicirello/pyaction from 4.11.0 to 4.11.1
- Replaced the usage of GitHub Action's deprecated
set-output
with the new$GITHUB_OUTPUT
env file. - Handle alternate casing of boolean inputs in GitHub workflow YAML files (previously expected lowercase).
- Refactored entrypoint for improved maintainability, and ease of planned new functionality.
- Bumped pyaction from 4.7.0 to 4.11.0, which includes upgrading Python in the Docker container to 3.10.7.
- Refactored index.html dropping logic to ease support for additional dropped index filenames.
- Checks .shtml files for noindex directives, excluding those that have it from the sitemap.
- Added index.shtml to set of index filenames that are dropped from URLs in sitemap.
- Bumped base docker image cicirello/pyaction from 4.3.1 to 4.7.0.
- Corrected check for robots noindex directive in case when non-utf8 characters present in an html file.
- Disabled pycache to protect against potential future bug. Currently no imports so no pycache created, but if future versions import local py modules, a pycache would be created during run in repo. Disabled creation of pycache now to avoid.
- Bumped base Docker image cicirello/pyaction from 4.2.0 to 4.3.1.
- Bumped Python to 3.10.
- Bumped base Docker image to pyaction 4.2.0.
- Now pulls base Docker image from the GitHub Container Registry rather than Docker Hub under the assumption that pulling from GitHub from GitHub Actions is likely faster than from Docker Hub.
- Upgraded base docker image to cicirello/pyaction:4.
- Added option to exclude
.html
from URLs listed in the sitemap for html files. GitHub Pages automatically serves a corresponding html file if a user browses to a page with a URL with no file extension. This new option to thegenerate-sitemap
action enables your sitemap to match this behavior if you prefer the extension-less look of URLs. There is a new action input,drop-html-extension
, to control this behavior.
- Use major release tag when pulling base docker image (e.g., automatically get non-breaking changes to base image, such as bug fixes, etc without need to update Dockerfile).
- Switched tag used to pull base Docker image from latest to the specific release that is the current latest, to enable testing against base image updates prior to releases. This is a purely non-functional change.
- Bug involving missing lastmod dates for website files created by the workflow, but not yet committed. These are now set using the current date and time.
- Refactored to improve code maintainability.
- Introduced major version tag.
- New action input,
additional-extensions
, that enables adding other indexable file types to the sitemap.
- Enabled CodeQL code scanning on all push/pull-request events.
- Improved the documentation (otherwise, this release is functionally equivalent to the previous release).
- Bug in generating URL for files with names ending in "index.html" but not exactly equal to "index.html", such as "aindex.html". Previous version would incorrectly truncate this to just "a", dropping the "index.html". This version now correctly identifies "index.html" files.
- Support for robots.txt: In addition to the previous
functionality of excluding html URL's that
contain
<meta name="robots" content="noindex">
directives, thegenerate-sitemap
GitHub action now parses arobots.txt
file, if present at the root of the website, excluding any URLs from the sitemap that matchDisallow:
rules forUser-agent: *
.
- Minor refactoring of python, and optimized action load time by using a prebuilt base docker image that includes exactly what is needed (git and python).
- Completely re-implemented in Python to enable more easily adding planned future functionality.
- URL sort order updated (primary sort is by depth of page in site, and URLs at same depth are then sorted alphabetically)
- URL sorting and URL filtering (skipping html files with meta robots noindex directives) is now implemented in Python
- Documentation updates
- Uses a new base Docker image, cicirello/alpine-plus-plus
- Sorting of sitemap entries.
This action generates a sitemap for a website hosted on
GitHub Pages. It supports both xml and txt sitemaps. When
generating an xml sitemap, it uses the last commit date
of each file to generate the <lastmod>
tag in the sitemap
entry. It can include html as well as pdf files in the
sitemap, and has inputs to control the included file types
(defaults include both html and pdf files in the sitemap). It
skips over html files that
contain <meta name="robots" content="noindex">
. It otherwise
does not currently attempt to respect a robots.txt
file.