- Notifications
You must be signed in to change notification settings - Fork143
Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site
License
jekyll/jekyll-sitemap
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site
- Add
gem 'jekyll-sitemap'to your site's Gemfile and runbundle - 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).
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.
gems key instead ofplugins.
The<lastmod> tag in thesitemap.xml will reflect by priority:
- The modified date of the file as reported by the filesystem if you have
jekyll-last-modified-atplugin installed (not compatible with GitHub Pages auto building) - A personalised date if you add the variable
last_modified_at:with a date in the Front Matter - The creation date of your post (corresponding to the
post.datevariable)
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
Follow these instructions on Jekyll's documentation.
- Use
script/bootstrapto bootstrap your local development environment. - Use
script/consoleto load a local IRB console with the Gem.
script/bootstrapscript/cibuild
- If the
sitemap.xmldoesn't generate in the_sitefolder, ensure_config.ymldoesn't havesafe: true. That prevents all plugins from working. - If the
sitemap.xmldoesn't generate in the_sitefolder, ensure that you don't have a sitemap generator plugin in your_pluginfolder.
- Fork the project
- Create a descriptively named feature branch
- Add your feature
- Submit a pull request
About
Jekyll plugin to silently generate a sitemaps.org compliant sitemap for your Jekyll site
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.