mkdocs_nype.extensions.material
Synopsis
mkdocs-material extension module
Works through being invoked from the mkdocs-nype __init__.py
file before the mkdocs-material plugins get to load etc.
In some cases, mkdocs-material plugins lack configurability and typically this issue is solved by adding another plugin with its own configuration that later overrides stuff during the MkDocs event loop.
However, some of those cases don't make much sense as a separate plugin with its own event loop, so this module aims to add those micro adjustments.
- Extend the
BlogConfig
class to be able to configure more options. - Monkey-patch some events to add logic before or after their execution to use the new options.
MIT License 2024 Kamil Krzyśków (HRY) for Nype (npe.cm)
INDEX_VARIANTS
All of the index-only display variants
INDEX_CARDS_WITH_CARD_CATEGORIES
All of the index display variants + normal cards all
BlogConfig
Bases: BlogConfig
Default values of the new options should match standard mkdocs-material behaviour
hide_read_more
Used later in templates to decide if the blog View
s should show the read more link for Excerpt
s
hide_post_metadata
Used later in templates to decide if the blog Views should show the metadata of the post, like the date and categories
blog_cards
blog_cards = Choice(('off', *INDEX_VARIANTS, 'all', *INDEX_CARDS_WITH_CARD_CATEGORIES), default='off')
Toggle the blog_cards to show on all View
s or only the index page
blog_card_continues
Mapping of category names to Continue Reading messages used in templates for the blog post cards. _default
key is reserved for the Default value.
blog_card_icons
Mapping of category names to icon paths used in templates for the blog post cards. _default
key is reserved for the Default value.
extend_blog
This function must be executed before the BlogPlugin
class is created and loaded into "MkDocs memory" via some other "import" during Plugin load