Build content with Contenticious
Here you'll learn how a (complex) file system structure with markdown documents will be rendered to web sites in detail.
How files and directories map to web sites
Your directory and file names become url path parts.
So the file pages/foo/bar/baz.md
will be available as /foo/bar/baz.html
.
That's it, basically.
The directory structure will be used to render a page navigation.
In the example above, the content of the directory pages/foo/bar
will show up as sub pages of /foo/bar.html
.
In the default design you'll need to click
on the corresponding link to view the sub navigation.
For example you need to click on First Steps to
view its sub navigation.
But what content will be visible after clicking on a directory link?
There are two options. The first option is the simple but pretty default
directory listing, which will be automagically generated from Contenticious.
But if there's a file named index.md
in that directory, Contenticious
will render its content instead of that listing. This method is used to
display the content of First Steps instead of a listing
of its three sub pages.
Build the navigation you want
Having that automatic navigation rendering in mind, you may want to define two things: order and names.
The order inside a navigation part is alphabetical like in your file managar,
so the page named bar.md
will show up before foo.md
.
If you want to change that order, just rename your file names to contain
numbers and an underscore ("_
") before the old name. So 17_foo.md
will go
before 42_bar.md
but Contenticious won't show that numbers in navigation
or URLs, so this is a great way to define an exact order.
By default, Contenticious will use the file or directory name for the
navigation, but this is not what you want in most cases. For example,
first_steps
is great in URLs, but First Steps
would be better in a
navigation for humans. As you learned while you created
your first Contenticious page there's the possibility
to provide meta information at each file's top lines. Just use navi_name
to change a page's name in the automagically generated page navigation:
navi_name: First Steps
Example
Here's a non-trivial example. The following directory structure is used to render this website. The generated navigation is the one you see on top.
file system urls ------------------------------------------------------- pages |-- index.md / |-- 01_first_steps (dir) | |-- index.md /first_steps.html | |-- 01_install.md /first_steps/install.html | |-- 02_prepare.md /first_steps/prepare.html | '-- 03_live.md /first_steps/live.html |-- 02_build_content.md /build_content.html |-- 03_deployment.md /deployment.html |-- 04_customize.md /customize.html '-- 05_about.md /about.html