Related Links broken when linking to blog posts
See original GitHub issueContribution guidelines
- I’ve read the contribution guidelines and wholeheartedly agree
I’ve found a bug and checked that …
- … the problem doesn’t occur with the
mkdocs
orreadthedocs
themes - … the problem persists when all overrides are removed, i.e.
custom_dir
,extra_javascript
andextra_css
- … the documentation does not mention anything about my problem
- … there are no open or closed issues that are related to my problem
Description
When linking to an existing blog post, a 404 error is produced.
Expected behaviour
The Related Links should work without error.
Actual behaviour
Linking to a blog post using the relative path of the Markdown file results in a 404 error. This can be seen in the official docs for two of the blog posts…
Both “Chinese search support” & “Excluding content from search” link to https://squidfunk.github.io/mkdocs-material/blog/posts/search-better-faster-smaller/, which produces a 404 error.
When adding a related link such as Hello World!, mkdocs serve
fails with the following error:
ERROR - Blog post ‘blog/posts/example.md’ has no date set.
Steps to reproduce
Using either of the following will not let the documentation build:
---
date: 2022-09-17
links:
- blog/posts/example.md
---
---
date: 2022-09-17
links:
- [Example}(blog/posts/example.md)
---
Package versions
Python: Python 3.9. MkDocs: mkdocs, version 1.3.1 Material: Version: 8.5.0+insiders.4.23.3
Configuration
site_name: My Docs
docs_dir: content
theme:
name: material
custom_dir: theme
include_search_page: false
search_index_only: true
features:
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- navigation.tracking
- navigation.instant
- navigation.indexes
- search.suggest
- search.share
- announce.dismiss
- content.code.annotate
- content.tooltips
plugins:
# Built-in
- search:
separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'
# Extra
- git-revision-date-localized:
type: timeago
enable_creation_date: true
exclude:
- index.md
- blog/archive/*
- blog/category/*
- glightbox:
touchNavigation: true
loop: false
effect: zoom
width: 100%
height: auto
zoomable: true
draggable: true
- minify:
minify_html: true
- offline:
enabled: !ENV [OFFLINE, false]
# Ensure Data Privacy
- privacy:
enabled: !ENV [PRIVACY, true]
externals: bundle
externals_dir: assets/externals
- blog
nav:
- Home: 'index.md'
- Blog:
- 'blog/index.md'
System information
Operating system: … macOS 12.5.1 Browser: … Firefox 104.0.2
Edit: Fixed formatting.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Released as part of 8.5.2-insiders-4.23.5.
Thanks! Glad to hear that. All feedback is welcome 😊