Bridgetown plugin to silently generate a sitemaps.org compliant sitemap for your Bridgetown site
- Install the plugin with the following command:
bundle add bridgetown-sitemap -g bridgetown_plugins
- Add the following to your site's
bridgetown.config.yml
:
url: "https://example.com" # the base hostname & protocol for your site
This plugin only supports Bridgetown sites that use the resource content engine.
This can be configured by adding the following line to your site's bridgetown.config.yml
:
content_engine: "resource"
The <lastmod>
tag in the sitemap.xml
will reflect by priority:
- A personalised date if you add the variable
last_modified_at:
with a date in the Front Matter. (Dates need to be formatted as%Y-%m-%d %H:%M:%S %z
) - The modified date of the file as reported by
git log
.
If you would like to exclude specific pages from the sitemap set the
sitemap flag to false
in the front matter for the page.
sitemap: false
To exclude multiple files, add a glob config to your bridgetown.config.yml
file.
defaults:
-
scope:
path: "assets/**/*.pdf"
values:
sitemap: false
- Run
bundle exec rake test
to run the test suite - Or run
script/cibuild
to validate with Rubocop and run tests together.
- Fork it (https://github.com/ayushn21/bridgetown-sitemap/fork)
- Clone the fork using
git clone
to your local development machine. - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Bridgetown Sitemap is released under the MIT License.
Copyright © 2021 Ayush Newatia