## 事象
[[MkDocs]]でビルドすると以下のようなINFOが表示される。
```
INFO - Doc file 'ja/releases/v3.md' contains an unrecognized relative link '../../models/trial', it was left as is. Did you mean '../models/trial.md'?
```
しかし、リンク先は正常 ( `../../models/trial.md` は存在する )なので、[[Markdown]]としてはNGでも[[MkDocs]]としてはOKにしてほしい。
`mkdocs.yml`
```yaml
site_name: Jumeaux
site_description: Check difference between two responses of API.
site_url: https://tadashi-aikawa.github.io/jumeaux/
site_author: tadashi-aikawa
site_dir: docs
repo_name: tadashi-aikawa/jumeaux
repo_url: https://github.com/tadashi-aikawa/jumeaux
copyright: © 2021 tadashi-aikawa
docs_dir: mkdocs
strict: true
edit_uri: edit/master/mkdocs/
nav:
- 🏠Home: index.md
- 👉Get Started:
- Quickstart: ja/getstarted/quickstart.md
- Configuration: ja/getstarted/configuration.md
- Report: ja/getstarted/report.md
- 🌍Addons:
- Summary: ja/addons/index.md
- log2reqs: ja/addons/log2reqs.md
- reqs2reqs: ja/addons/reqs2reqs.md
- res2res: ja/addons/res2res.md
- res2dict: ja/addons/res2dict.md
- judgement: ja/addons/judgement.md
- store_criterion: ja/addons/store_criterion.md
- dump: ja/addons/dump.md
- did_challenge: ja/addons/did_challenge.md
- final: ja/addons/final.md
- 💽Models:
- AccessPoint: ja/models/access-point.md
- Notifier: ja/models/notifier.md
- Request: ja/models/request.md
- Response: ja/models/response.md
- Trial: ja/models/trial.md
- 📝Template: ja/template.md
- 📦Releases:
- All: ja/releases/index.md
- v6.x.y: ja/releases/v6.md
- v5.x.y: ja/releases/v5.md
- v4.x.y: ja/releases/v4.md
- v3.x.y: ja/releases/v3.md
- v2.x.y: ja/releases/v2.md
- v1.x.y: ja/releases/v1.md
- v0.x.y: ja/releases/v0.md
theme:
name: material
language: "ja"
feature:
tabs: false
logo: "img/logo.png"
favicon: "img/favicon.ico"
plugins:
- search:
lang:
- en
extra:
social:
- icon: fontawesome/brands/github-alt
link: "https://github.com/tadashi-aikawa"
- icon: fontawesome/brands/twitter
link: "https://twitter.com/Tadashi_MAMAN"
markdown_extensions:
- meta
# 内部参照
- wikilinks
# 改行が2spaceじゃなくてもOK
- nl2br
# warningとか
- admonition
# 注釈
- footnotes
# コードのsyntax
- codehilite:
guess_lang: false
- toc:
permalink: True
# expandableにする
- pymdownx.details
# 絵文字対応
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator:
!!python/name:material.extensions.emoji.to_svg # HTMLやemailをリンク化
- pymdownx.magiclink
# 別のmarkdownファイルを埋め込み可能
- pymdownx.snippets:
base_path: mkdocs
# indentされた中でのcode blockとか
- pymdownx.superfences
extra_css:
- "https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css"
- "css/custom.css"
```
### 環境
| 対象 | バージョン |
| ----------------------- | ------ |
| [[MkDocs]] | 1.6.1 |
| [[Material for MkDocs]] | 9.5.49 |
## 原因
[MkDocsでMarkdownファイルへの純粋なリンク以外のリンク切れはINFOログを出すようになった](https://www.mkdocs.org/about/release-notes/#expanded-validation-of-links)から。
## 解決方法
INFOログに従ってリンクを修正する。
```diff
- [trial]: ../../models/trial
+ [trial]: ../models/trial.md
```
> [!info]
> 非推奨とされているが、validationを無効化するとINFOログを削除することもできる。
>
> > If you don't want any changes, not even the INFO messages, and wish to revert to the silence from MkDocs 1.4, add the following configs to mkdocs.yml (**not** recommended):
>
> ```yaml
> validation:
> links:
> absolute_links: ignore
> unrecognized_links: ignore
> ```
## 参考
- [False positive `relative_to_docs` absolute path validation warning · Issue #3589 · mkdocs/mkdocs](https://github.com/mkdocs/mkdocs/issues/3589)