👉 日本語版は こちら
When building documentation with GitHub Pages (Pages) and Jekyll, many writers wonder:
.md
files?.md
and .html
links?GitHub Pages (with its default Jekyll setup) provides powerful, automatic handling of Markdown links—thanks to built-in plugins like jekyll-relative-links
. This article summarizes behaviors I observed and explains how it all works, so you can write Markdown links with confidence.
📝 Note:
The behavior described in this document is based on my experiments and observations in Sep 2025. They may vary in the future.
README.md
is recognized as the primary index, not index.md
.index.html
is recognized as the primary index. This is not unique to Pages, but is standard behavior for HTML servers, which Pages follows.Pages attempts to convert both index.md
and README.md
into index.html
. This naturally causes a conflict when the both coexist. In that case, the page generation algorithm always finds and converts index.md
first, so README.md
is ignored.
📝 Additional Note:
If you create an index.md
in addition to an existing README.md
, index.md
will be converted to index.html
, overwriting any previous version. If you then remove index.md
and leave README.md
, a new index.html
will be generated from README.md
. I have observed some inconsistent results, which may suggest a race condition in the generation process.
_config.yml
plugins:
- jekyll-sitemap
My _config.yml
is this simple. See Best Practices & Practical Tips.
Linux/OpenSSL/
Linux/OpenSSL/
)./Linux/OpenSSL/
displays the rendered index.html
.vSphere/vcsa-cert-replace-procedures/README.md
/Straypenguins-Tips-Inventory/vSphere/vcsa-cert-replace-procedures/
), with no filename.index.html
is displayed.vcsa-cert-replace-procedures.md
.html
, such as /Straypenguins-Tips-Inventory/vSphere/vcsa-cert-replace-procedures/vcsa-cert-replace-procedures.html
..html
page.jekyll-relative-links
PluginGitHub Pages enables several Jekyll plugins by default (see official docs), including:
jekyll-relative-links
jekyll-readme-index
jekyll-relative-links is key:
It automatically rewrites Markdown links between .md
files so that, when your site is built, links point to the corresponding .html
files (or directory paths for index.html
). This means you can write all your internal links simply as [Label](other-page.md)
or [Label](Subfolder/)
, and they’ll Just Work™ in the published site.
.md
or directory references in your Markdown files..html
for the site!index.html
for their folder, accessible via the directory path.README.md
(and not index.md
) appears to be the best practice..md
) and GitHub Pages view (.html
) to readers,.md
link suffices.
- vCSA Certificate Replacement (GitHub Web) / (GitHub Pages HTML)
jekyll-relative-links
or other plugins in _config.yml
—they’re enabled by default on GitHub Pages._config.yml
unless you have a specific requirement.