mirror of
https://github.com/docker/docs.git
synced 2026-04-03 01:38:58 +07:00
When generating HTML pages, Jekyll will generate a directory named after the name of the Markdown file, and generate an index.html file inside that directory. For example, for a markdown file named /foo/bar/mypage.md, Jekyll generates a HTML file named /foo/bar/mypage/index.html. This means that all links relative to mypage.md, and expect those links to be relative to the /foo/bar/ directory, will actually end up being relative to /foo/bar/mypage/. Unfortunately, Jekyll / Liquid does not have a variable that holds the parent directory of the _markdown_ file, so we have to generate it by taking `page.path` (which holds the absolute path of the markdownfile), and remove the filename from that path. After generating that path, we prepend that path to URLs linking to related commands (parent commands and child commands), as all reference files are in the same path. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>