GithubHelp home page GithubHelp logo

michaelnordmeyer / jekyll-sitemap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jekyll/jekyll-sitemap

0.0 2.0 0.0 308 KB

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

Home Page: http://rubygems.org/gems/jekyll-sitemap

License: MIT License

Ruby 97.09% Shell 2.91%

jekyll-sitemap's Introduction

Jekyll Sitemap Generator Plugin

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

Build Status

Usage

  1. Add gem 'jekyll-sitemap' to your site's Gemfile and run bundle
  2. Add the following to your site's _config.yml:
url: "https://example.com" # the base hostname & protocol for your site
plugins:
  - jekyll-sitemap

๐Ÿ’ก If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.

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.pages, site.posts, or site.collections, be sure to require jekyll-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-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 _config.yml.

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

โš ๏ธ If you are using Jekyll < 3.5.0 use the gems key instead of plugins.

<lastmod> tag

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

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

Exclusions

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.

sitemap: false

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 _config.yml file.

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

Override default development settings

Follow these instructions on Jekyll's documentation.

Developing locally

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

Testing

  1. script/bootstrap
  2. script/cibuild

Known Issues

  1. If the sitemap.xml doesn't generate in the _site folder, ensure _config.yml doesn't have safe: true. That prevents all plugins from working.
  2. If the sitemap.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

jekyll-sitemap's People

Contributors

parkr avatar pathawks avatar jekyllbot avatar dirtyf avatar benbalter avatar ashmaroli avatar alekseyg avatar blairanderson avatar coliff avatar sankage avatar jamieconnolly avatar kishanbagaria avatar wikimatze avatar stve avatar a-mt avatar ajmichels avatar yous avatar davidsilvasmith avatar amdmi3 avatar emmahsax avatar hayleycanderson avatar jakob-stoeck avatar artlogic avatar johnpitchko avatar envygeeks avatar jveillet avatar msh100 avatar itafroma avatar nickjj avatar oncleben31 avatar

Watchers

Michael Nordmeyer avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.