[GH-ISSUE #578] Linting DRY markdown for Jekyll pages (resolve "include_relative") #457

Closed
opened 2026-03-03 01:27:05 +03:00 by kerem · 2 comments
Owner

Originally created by @pbronneberg on GitHub (Sep 9, 2022).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/578

For markdown pages that we render through Jekyll, we have moved common references to a references.md file.
In all pages, the common references are included like shown in this example:

I want to use a reference defined single file and still use [a linter][markdown-lint]

{% include_relative references.md %}

An example of references.md:

[markdown-lint]: https://github.com/DavidAnson/markdownlint

[some-other-link]: https://www.github.com

Since the cross-references checks were introduced recently, this leads to MD053 linting errors:
"MD053/link-image-reference-definitions: Link and image reference definitions should be needed [Unused link or image reference definition: "markdown-lint"]"

Any hints to overcome this without disabling MD053?

Originally created by @pbronneberg on GitHub (Sep 9, 2022). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/578 For markdown pages that we render through Jekyll, we have moved common references to a `references.md` file. In all pages, the common references are included like shown in this example: ```MARKDOWN I want to use a reference defined single file and still use [a linter][markdown-lint] {% include_relative references.md %} ``` An example of `references.md`: ```MARKDOWN [markdown-lint]: https://github.com/DavidAnson/markdownlint [some-other-link]: https://www.github.com ``` Since the cross-references checks were introduced recently, this leads to `MD053` linting errors: "MD053/link-image-reference-definitions: Link and image reference definitions should be needed [Unused link or image reference definition: \"markdown-lint\"]" Any hints to overcome this without disabling `MD053`?
kerem 2026-03-03 01:27:05 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@DavidAnson commented on GitHub (Sep 9, 2022):

In situations like this, I recommend linting the final Markdown output (rather than the pieces that are used to create it).

<!-- gh-comment-id:1242164218 --> @DavidAnson commented on GitHub (Sep 9, 2022): In situations like this, I recommend linting the final Markdown output (rather than the pieces that are used to create it).
Author
Owner

@pbronneberg commented on GitHub (Sep 10, 2022):

Thanks for the reply! Will see where we can apply that approach.

As far as I've investigated now, Jekyll does not provide an option to just combine the markdown. I will create a question on the Jekyll repo In the meantime, we'll decide to either script this ourselves or ignore the errors.

<!-- gh-comment-id:1242669470 --> @pbronneberg commented on GitHub (Sep 10, 2022): Thanks for the reply! Will see where we can apply that approach. As far as I've investigated now, Jekyll does not provide an option to just combine the markdown. I will create a question on the Jekyll repo In the meantime, we'll decide to either script this ourselves or ignore the errors.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#457
No description provided.