How to have /year/month/slug.html
as blog URL
#6430
-
Hello, Current blog post url format is: as I'm migrating from other blog system to mkdocs-material, the orignal url format is: is there a way to keep the orignal format in mkdocs-material ? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hello, To remove the |
Beta Was this translation helpful? Give feedback.
-
@kamilkrzyskow Say I have a blog post with top level head:
Within the old blog system, its slug is : |
Beta Was this translation helpful? Give feedback.
Hello,
I modified the https://github.com/mkdocs-material/examples/tree/master/examples/blog-basic example for your needs;
blog-basic-for-copdips.zip
To remove the
blog
prefix of the URL you need to setup a stand-alone blog only site:https://squidfunk.github.io/mkdocs-material/plugins/blog/#config.blog_dir-blog-only
To remove the
day
part of the URL you need to change thepost_url_date_format
option:https://squidfunk.github.io/mkdocs-material/plugins/blog/#config.post_url_date_format
To enable
.html
path endings you need to disable theuse_directory_urls
global MkDocs option:https://www.mkdocs.org/user-guide/configuration/#use_directory_urls