Routing Rules
mkpages preserves structure relative to the chosen content root.
Core rules
index.mdmaps to the containing directoryREADME.mdmaps to the containing directory whenindex.mdis absent- any other
name.mdmaps toname/ - nested structure is preserved relative to the content root
Examples
If the command is:
mkpages .
then:
index.mdbecomes/docs/index.mdbecomes/docs/blog/post-1.mdbecomes/blog/post-1/
If the command is:
mkpages docs/
then:
docs/index.mdbecomes/docs/getting-started.mdbecomes/getting-started/docs/examples/default.mdbecomes/examples/default/
Link rewriting
Relative Markdown links such as CLI Reference are rewritten so they continue to work after route generation.
Permalink overrides
The rules above determine the default route that mkpages generates. mkpages
preserves YAML front matter, so Jekyll can override that route with a
permalink value.
---
permalink: /blog/my-post/
---
For example, blog/my-post.md normally uses /blog/my-post/, but a
permalink can publish it at a different path.
More front matter information is available in Front Matter.