Coder Social home page Coder Social logo

jekyll-sitemap-ng's Introduction

Jekyll Plugin: Sitemap.xml Generator

Sitemap.xml Generator is a Jekyll plugin that generates a sitemap.xml file by traversing all of the available posts and pages.

How To Use:

  1. Copy file into your _plugins folder within your Jekyll project or add as submodule.
  2. Ensure url is set in your config file (for example url: http://www.domain.com)
  3. In your config file, change sitemap: filename: if you want your sitemap to be called something other than "sitemap.xml".
  4. Change the sitemap: exclude: list to exclude any pages that you don't want in the sitemap.
  5. Change the sitemap: include_posts: list to include any pages that are looping through your posts (e.g. "/index.html", "/notebook/index.md", etc.). This will ensure that right after you make a new post, the last modified date will be updated to reflect the new post.
  6. Run Jekyll: jekyll build to re-generate your site.
  7. A sitemap.xml should be included in your _site folder.
  8. Remember to submit the sitemap URL to Google and add a robots.txt

Configuration defaults:

sitemap:
    filename: "/sitemap.xml"
    exclude:
        - "/atom.xml"
        - "/feed.xml"
        - "/feed/index.xml"
    include_posts:
        - "/index.html"
    change_frequency_name: "change_frequency"
    priority_name: "priority"
    lastmod_name: "lastmod"
    frequency:
        posts: "monthly"
        pages: "yearly"
        index: "monthly" 
    priority: 
        posts: 0.5
        pages: 0.3
        index: 0.4

Customizations:

If you want to include the optional <changefreq> and <priority> attributes, simply include custom variables in the YAML Front Matter of those files. The names of these custom variables are defined in the config file as sitemap: change_frequency_name: and sitemap: priority_name:. Alternatively, you can set them in the configuration under sitemap: frequency: and sitemap: priority: as seen in the example above.

Notes:

  1. URLs that match include_posts are considered indexes, for frequency and priority.

Author: Pedro Monjo (https://www.pedromonjo.com)

Forked from Jekyll Plugin: Sitemap.xml Generator by Michael Levin (http://www.kinnetica.com)

Distributed Under A Creative Commons License

jekyll-sitemap-ng's People

Contributors

mlevin avatar danielgroves avatar pmonjo avatar nicolashery avatar philips avatar edelabar avatar brainlid avatar matthiaswinkelmann avatar peterheard01 avatar pke avatar henry0312 avatar vikramtiwari avatar danfran 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.