-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Context
I tried to set a short url for the build-in blog archive with archive_url_format: "{date}".
Bug description
Setting archive_url_format: "{date}" results in an error that excludes pages from the blog directory from being built by MkDocs.
mkdocs.yml:
plugins:
- blog:
archive_url_format: "{date}"
Files:
.
├─ docs/
│ └─ blog/
│ ├─ lorem/
│ │ └─ blog-page.md 👎
│ ├─ posts/
│ ├─ blog-page.md 👎
│ └─ index.md 👎
└─ mkdocs.yml
Error:
INFO - Building documentation...
INFO - Cleaning site directory
INFO - A reference to 'blog/index.md' is included in the 'nav' configuration, but this file is excluded from the built site.
INFO - A reference to 'blog/blog-page.md' is included in the 'nav' configuration, but this file is excluded from the built site.
INFO - A reference to 'blog/lorem/blog-page.md' is included in the 'nav' configuration, but this file is excluded from the built site.
INFO - Documentation built in 0.16 seconds
Temp. fix:
Setting archive_url_format: "a/{date}" or leaving it default ("archive/{date}").
More tests:
I was curious if this bug would affect: custom category pages or hand made yyyy.md pages.
It turned out that these pages work properly...
.
├─ docs/
│ └─ blog/
│ ├─ category/
│ │ └─ custom-category-page.md 👍
│ ├─ lorem/
│ │ └─ blog-page.md 👎
│ ├─ posts/
│ │ └─ (some posts from 2020 and 2023 with "custom-category-page" category)
│ ├─ blog-page.md 👎
│ ├─ 2023.md 👍
│ ├─ 2020.md 👍
│ └─ index.md 👎
└─ mkdocs.yml
The bug is also present in the Insiders version.
EDIT: @squidfunk I got same issue with "categories_url_format: "{slug}" btw.
Related links
Reproduction
(Contrary to the name, these reproductions are not based on the Insiders version.)
Minimal reproduction:
9.2.5+insiders.4.40.1-archive-url-turn-md-excluded.zip
Reproduction from tests (yyyy.md + category/name.md):
9.2.5+insiders.4.40.1-same-bug-but-yyyy-cat-works.zip
mkdocs 1.5.2
mkdocs-material 9.2.5
mkdocs-material-extensions 1.1.1
Steps to reproduce
- Setup fresh venv.
python3 -m venv venv
. venv/bin/activate
pip install --upgrade --force-reinstall mkdocs-material
mkdocs new .
- Setup
mkdocs.ymlwith blog pluginarchive_url_format: "{date}"option - Make some
*.md's inside blog dir that do not cover dates (yyyy.md) or category names (category/name.md). - Run build.
Browser
No response
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.