-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing incompatibility between markdown-link-check and not having every page managed as an Hugo section #294
Comments
The problem comes from how Hugo renders markdown content to HTML. If you have the following source structure:
it will be rendered to this HTML structure when the site is deployed:
This is why you can reference an image from a page markdown directly if the page's resources are in a folder named the same as the basename of the page, which is on the same level as the page. E.g. this Markdown requires the paths to referenced resources to be relative to the file in which they are written, which is not true on our source tree above. And the only markdown linter we have checks links according to Markdown rules, then correctly fails the source as being incorrect. |
The solutions I see possible:
|
Solution 1 is preferable as the error will link to the proper line in the source code, while for solution 2 it will likely not be the case. |
Checking relative links pointing to providers/cloud-compute is broken since long, as documented in #294
Currently all the markdown pages are created like this:
about
orconcepts
_index.md
files under those folder.This is in fact expected to be only done for sections and leads to having all the pages with a section-specific formatting.
Ideally pages under a section should not be added in a folder:
The problem is that markdown-link-check is failing at finding the proper leaf file (like
concepts.md
).We could try to address this problem in https://github.com/tcort/markdown-link-check or look for an alternative way to check files.
https://github.com/stevenvachon/broken-link-checker or https://github.com/celinekurpershoek/link-checker could be used to check the output rendered by Hugo, but error messages wouldn't allow to trace back to the source files.
The text was updated successfully, but these errors were encountered: