🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

bridgetown-sitemap

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bridgetown-sitemap

bundlerRubygems
Version
3.0.0
Version published
Maintainers
1
Created
Source

Bridgetown Sitemap Generator Plugin

Tests Gem Version

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

Usage

  • Install the plugin with the following command:
bundle add bridgetown-sitemap
  • Add the following to your site's config/initializers.rb:
Bridgetown.configure do |config|
  config.url = "https://example.com" # the base hostname & protocol for your site

  init :"bridgetown-sitemap"
end

<lastmod> tag

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.

<priority> and <changefreq> tag

You can optionally specify a priority and change frequency for each page in your site by adding the following to the Front Matter of each page:

sitemap_priority: 0.7
sitemap_change_frequency: weekly

This will add the following to the <url> tag in the sitemap.xml:

<priority>0.7</priority>
<changefreq>weekly</changefreq>

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 config/initializers.rb file.

Bridgetown.configure do |config|
  # ...

  config.defaults << {
    "scope" => { "path" => "assets/**/*.pdf" },
    "values" => { "sitemap" => false }
  }
end

Testing

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

Contributing

  • 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

License

Bridgetown Sitemap is released under the MIT License.

Copyright © 2023 Ayush Newatia

FAQs

Package last updated on 24 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts