Skip to content

mkdocs_nype.plugins.similar_blog_posts.config

SingleValueOrList

Bases: Type

There is no mixed str/list[str] type provided by MkDocs, so this custom type allows for this

run_validation

run_validation(value: object)

SimilarBlogPostsConfig

Bases: Config

enabled

enabled = Type(bool, default=True)

hook_blog_dir

hook_blog_dir = SingleValueOrList(str)

A single value or list of matching blog_dir prefixes

append_at

append_at = Choice(('start', 'end'), default='end')

Where to add the section

title

title = Type(str)

Title of the section

similarity_threshold

similarity_threshold = Type(float, default=0.32)

Float number between 0 and 1 to decide if the posts should be considered similar

allow_other_categories

allow_other_categories = Type(bool, default=True)

If a given category doesn't have enough (max_shown) similar posts, show posts from other categories

max_shown

max_shown = Type(int, default=5)

Limit the number of shown posts