Allows mkdocs
to be used as a simple blog.
Features:
Assumes blog content is laid out in a standardized format with numeric years and months as follows:
docs/<year>/<month>/page.md
Within a month, file modification time is used to provide chronological ordering.
Hi, could you add a LICENSE file to your repository? It would help to improve https://github.com/pawamoy/best-of-mkdocs contents :slightly_smiling_face: If this project is unmaintained, just let me know :+1:
Looking at this plugin, I was wondering if it can be used to create a overview page of current blog posts in a similar fashion to what Squidfunk has for his "blog" shown here: https://squidfunk.github.io/mkdocs-material/blog/
Unfortunately is that page there a manual thing, so if there is a way to use this plugin to make an automated generation of such a page, or a similar one, would I appreciate any help with doing this.
The source of the above page, if needed, is here: https://github.com/squidfunk/mkdocs-material/blob/master/docs/blog/index.md
When following the example "archive.md"
```jinja This is a list of posts, first grouped by year, then month, then sorted by age.
{% set chronological = config['chronological'] %}
{% for year in chronological|sort(reverse=True) %}
{% for month in chronological[year] %}
{% endfor %} ```
the page titles are shown as None
.
I debugged it a little and printed page.meta
which was an empty dictionary when printed to the jinja template, although I have set it using YAML syntax (also tried without setting the metadata title
since I guess it should be set from the filename). I checked using a breakpoint()
inside the mkdocs
source code that the page.meta
(and also page.title
) is read correctly (inside the Page class code), so something happens between that point of code and passing the page to the jinja template.
At time being, seems that replacing {{ page.title }}
with {{ page.file.url[:-5].split('/')[-1] }}
or {{ page.file.url[:-5] }}
gives a desired output.
mkdocs 1.1.2
mkdocs-blog 0.1.0
mkdocs-bootstrap4 0.1.4
mkdocs-git-committers-plugin 0.1.10
(tried also while disabling the mkdocs-bootstrap4 theme).This concept seems really useful and I want to give it a try, but documentation is sparse. Can you add more details on how to install and run mkdocs-blog? Maybe provide an example project?