Jekyll plugin to silently generate Google News Sitemap based on posts
This gem was heavily influenced by jekyll-sitemap and is still “work-in-progress”.
gem 'jekyll-news-sitemap'to your site’s Gemfile and run
- Add the following to your site’s
url: "https://example.com" # the base hostname & protocol for your site publisher: "The Example Times" plugins: - jekyll-news-sitemap
💡 If you are using a Jekyll version less than 3.5.0, use the
gems key instead of
If all gem plugins have the same
priority, they will be executed in the order they are required, generally. Thus, if you have other plugins which generate content and store that content in
site.collections, be sure to require
jekyll-news-sitemap either after those other gems if you want the sitemap to include the generated content, or before those other gems if you don’t want the sitemap to include the generated content from the gems. (Programming is hard.)
Because the sitemap is added to
site.pages, you may have to modify any templates that iterate through all pages (for example, to build a menu of all of the site’s content).
Note on Use with GitHub Pages Gem
The GitHub Pages gem ignores all plugins included in the Gemfile. If you only include
jekyll-news-sitemap in the Gemfile without also including it in the
_config.yml the plugin will not work. This can be confusing because the official Jekyll docs state that plugins can be included in either the Gemfile or
When building a site that uses the GitHub Pages gem, follow the instructions above and ensure that
jekyll-news-sitemap is listed in the
plugins array in
:warning: If you are using Jekyll < 3.5.0 use the
gems key instead of
If you would like to exclude specific pages/posts from the sitemap set the sitemap flag to
false in the front matter for the page/post.
To exclude files from your sitemap. It can be achieved with configuration using Jekyll v3.7.2 and jekyll-sitemap v1.2.0.
Add a glob config to your
defaults: - scope: path: "assets/**/*.pdf" values: sitemap: false
Override default development settings
script/bootstrapto bootstrap your local development environment.
script/consoleto load a local IRB console with the Gem.
- Fork the project
- Create a descriptively named feature branch
- Add your feature
- Submit a pull request