Closed balansczerni closed 1 year ago
Thanks for reporting. Hmm, turns out it's harder than I though to support custom index pages while retaining complete freedom over how the navigation is defined (which the rewrite was all about). I'll look into it asap. In the meantime, you should use a discernable prefix for archive pages, i.e., archive
. It's generally not advisable to drop the prefix archive
and category
, because the generated pages might clash with (or even overwrite) pages with the same filename.
The bug is also present in the Insiders version.
Custom index pages are currently only supported in the Insiders edition – it's a sponsorware feature which will be released to the community edition once the 'Chipotle' funding goal is hit. If you try to add custom index pages in the community edition, behavior will be undefined and the build will most likely not work, which is expected.
Fixed in a0280cb
. I've taken the time and did a refactoring, unifying how views and pages are constructed. There might still be issues, as it's still a ground up rewrite of what we had before, but I feel that we made a big leap in the right direction!
Released as part of 9.2.6+insiders-4.40.2.
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:
Files:
Error:
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...
The bug is also present in the Insiders version.
EDIT: @squidfunk I got same issue with
"categories_url_format: "{slug}"
btw.Related links
Reporting a bug
Setting up a blog #archive
Setting up a blog #adding-pages
Source of error is from mkdocs/mkdocs/commands/build.py / line 323
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
Steps to reproduce
mkdocs.yml
with blog pluginarchive_url_format: "{date}"
option*.md
's inside blog dir that do not cover dates (yyyy.md
) or category names (category/name.md
).Browser
No response
Before submitting