Skip to content
Snippets Groups Projects
Alex Iribarren's avatar
Alex Iribarren authored
LOS-1071: Update plugin to allow new use-cases

See merge request !2
3d4bf508
History

updates_autogeneration_plugin

This is a custom plugin to autogenerate latest distro updates on our mkdocs linux website as well as a sitemap page than you can reference in your MKDocs config file.

Warning! Please be aware that this repo URL is referenced on https://gitlab.cern.ch/linuxsupport/websites/linux.cern.ch so be aware if you decide to move the repo from this namespace

Setup

You can add this requirement to your requirements.txt file and use git including:

# Our custom plugin to autogenerate latest updates
git+https://gitlab.cern.ch/linuxsupport/websites/updates-autogeneration-plugin.git@master#egg=updates-autogeneration-plugin

Activate the plugin in mkdocs.yml:

plugins:
  - updates-autogeneration-plugin:
      autogenerate_path:
        - AUTOGENERATE_C8:
            section_name: C8
            path: updates/c8/
        - AUTOGENERATE_CC7:
            section_name: CC7
            path: updates/scl6/
        - AUTOGENERATE_SLC6:
            section_name: SLC6
            path: updates/scl6/
      # Choose to autogenerate a sitemap page, static_templates cannot be used as they only have the defined nav, not all items
      autogenerate_sitemap: true
  - search

nav:
    - 'Introduction': index.md
    - 'Updates':
        - CC7: updates/index.md
        - AUTOGENERATE_C8
        - AUTOGENERATE_CC7
        - AUTOGENERATE_SCL6
    # This page is autogenerated by the updates-autogeneration-plugin
    # Since the file must pre-exist to be usable as /sitemap.md, we use the url
    - 'Sitemap': /sitemap

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.