tomjoht / documentation-theme-jekyll

A Jekyll-based theme designed for documentation and help systems. See the link for detailed instructions on setting up and configuring everything.

Home Page:http://idratherbewriting.com/documentation-theme-jekyll/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to create subfolder navigation?

sdole opened this issue · comments

Hello,

How do I create urls such as http://www.example.com/folder1/folder2/mydocs_adoc.html? I attempted to create folders for my content, but, something flattens it out into the root folder.

Thanks,
Sachin

I'm not sure about generating permalinks from paths yet but I have used this so far to get the same result (A bit of repetition here that could be generated).
In each page's frontmatter use
permalink: Product\/PageName

For urls you find in yml files you can prepend ../ several times, afaik most browsers don't let you go directories higher than the base url. Forward slashes need to be escaped with a backslash.

In your topnav.yml

- title: Product PageName
  url: ..\/..\/Product\/PageName

Make sure url is set in your _config.yml and go through your includes and prefix any relative href or src with {{ site.url }} so it looks like
<link rel="stylesheet" href="{{site.url}}/css/customstyles.css">
for example.
This will only work on your live copy or local test copy depending only what your set your url to. You can add ../ to the start of each reference instead if you prefer.

To get search working you need to change search.json and modify both instances of "url": "{{ post.url | remove: "/" }}", to "url": "{{ post.url }}", Dropping the | remove "/" This doesn't seem to cause any problems afaik.