Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create subfolder navigation? #208

Open
sdole opened this issue Mar 1, 2021 · 1 comment
Open

How to create subfolder navigation? #208

sdole opened this issue Mar 1, 2021 · 1 comment

Comments

@sdole
Copy link

sdole commented Mar 1, 2021

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

@1337cookie
Copy link

1337cookie commented Jun 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants