Okay, thank you for that. The easiest way to handle what you are looking for is to use a little Liquid logic in the area where you create the Home
link. You can inspect the URL and see if it contains a specific word.
Your original code looks like this:
<div class="inner">
<a href="/operationGuide" class="code"><span>Home</span></a>
</div>
With new code that looks at the page.url
and determines the link, like this:
./your-menu-code.html
<div class="inner">
{%- if page.url contains 'DemoGuide' -%}
<a class="page-link" href="{{ "/DemoGuide/index.html" | relative_url }}">Home</a>
{%- else -%}
<a class="page-link" href="{{ "/" | relative_url }}">Home</a>
{%- endif -%}
</div>
To make the code more reusable, you can add two variables to your config.yml
file that allow you to pattern match:
./_config.yml
# Put these lines anywhere you want
demo_guide: "DemoGuide"
demo_guide_url: "/DemoGuide/index.html"
Then you can modify your menu code like this:
./your-menu-code.html
<div class="inner">
{%- if page.url contains site.demo_guide -%}
<a class="page-link" href="{{ site.demo_guide_url | relative_url }}">Home</a>
{%- else -%}
<a class="page-link" href="{{ "/" | relative_url }}">Home</a>
{%- endif -%}
</div>
Important: If you are testing locally, do not forget to stop and start Jekyll after you modify the _config.yml
Of course, you could get more advanced and look for a specific word that is not in the filename, etc. but this is how you can get started.
Consider Jekyll Collections
If you are not already doing so, you might want to seriously consider using Jekyll Collections for your documentation. That will make your life easier and you do not have to worry about inspecting the URL and you can also use other features useful for documentation.
Below is a link to the documentation for collections. Please note that it talks about creating a list of post authors, but keep your mind open to the idea that you could create a collection of Demo Docs and a collection of API Docs, etc.