Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

jekyll/jekyll-sitemap

Repository files navigation

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

Build Status

Usage

  1. Addgem 'jekyll-sitemap' to your site's Gemfile and runbundle
  2. Add the following to your site's_config.yml:
url:"https://example.com"# the base hostname & protocol for your siteplugins:  -jekyll-sitemap

💡 If you are using a Jekyll version less than 3.5.0, use thegems key instead ofplugins.

If all gem plugins have the samepriority, they will be executed in theorder they are required, generally. Thus, if you have other plugins whichgenerate content and store that content insite.pages,site.posts, orsite.collections, be sure to requirejekyll-sitemap eitherafterthose other gems if youwant the sitemap to include the generatedcontent, orbefore those other gems if youdon't want the sitemap toinclude the generated content from the gems. (Programming ishard.)

Because the sitemap is added tosite.pages, you may have to modify anytemplates that iterate through all pages (for example, to build a menu ofall 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 includejekyll-sitemap in the Gemfile without also including it in the_config.ymlthe plugin will not work. This can be confusing because the official Jekyll docs state that plugins can be included in either the Gemfile or_config.yml.

When building a site that uses the GitHub Pages gem, follow the instructions above and ensure thatjekyll-sitemap is listed in theplugins array in_config.yml.

⚠️ If you are using Jekyll < 3.5.0 use thegems key instead ofplugins.

<lastmod> tag

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

  1. The modified date of the file as reported by the filesystem if you havejekyll-last-modified-at plugin installed (not compatible with GitHub Pages auto building)
  2. A personalised date if you add the variablelast_modified_at: with a date in the Front Matter
  3. The creation date of your post (corresponding to thepost.date variable)

Exclusions

If you would like to exclude specific pages/posts from the sitemap set thesitemap flag tofalse in the front matter for the page/post.

sitemap:false

To exclude files from your sitemap. It can be achieved with configuration usingJekyll v3.7.2 and jekyll-sitemap v1.2.0.

Add a glob config to your_config.yml file.

defaults:  -scope:path:"assets/**/*.pdf"values:sitemap:false

Override default development settings

Follow these instructions on Jekyll's documentation.

Developing locally

  • Usescript/bootstrap to bootstrap your local development environment.
  • Usescript/console to load a local IRB console with the Gem.

Testing

  1. script/bootstrap
  2. script/cibuild

Known Issues

  1. If thesitemap.xml doesn't generate in the_site folder, ensure_config.yml doesn't havesafe: true. That prevents all plugins from working.
  2. If thesitemap.xml doesn't generate in the_site folder, ensure that you don't have a sitemap generator plugin in your_plugin folder.

Contributing

  1. Fork the project
  2. Create a descriptively named feature branch
  3. Add your feature
  4. Submit a pull request

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors35


[8]ページ先頭

©2009-2025 Movatter.jp