johlym / bridgetown-sitemap

A Bridgetown plugin to generate a sitemap.xml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bridgetown Sitemap Generator Plugin

Tests Gem Version

Bridgetown plugin to silently generate a sitemaps.org compliant sitemap for your Bridgetown site

Usage

  1. Install the plugin with the following command:
bundle add bridgetown-sitemap -g bridgetown_plugins
  1. 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"

<lastmod> tag

The <lastmod> tag in the sitemap.xml will reflect by priority:

  1. 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)
  2. The modified date of the file as reported by git log.

Exclusions

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

Testing

  • Run bundle exec rake test to run the test suite
  • Or run script/cibuild to validate with Rubocop and run tests together.

Contributing

  1. Fork it (https://github.com/ayushn21/bridgetown-sitemap/fork)
  2. Clone the fork using git clone to your local development machine.
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

License

Bridgetown Sitemap is released under the MIT License.

Copyright © 2021 Ayush Newatia

About

A Bridgetown plugin to generate a sitemap.xml

License:MIT License


Languages

Language:Ruby 85.8%Language:HTML 9.7%Language:Shell 4.3%Language:Liquid 0.3%