Add support for folder urls in the sidebar.
If present, clicking the folder goes to the URL itself. Toggling the folder requires clicking the toggle arrow precisely. If URL is omitted, the whole folder title works as a toggle.
This commit is contained in:
@ -23,8 +23,8 @@ to _config.yml, which requires restarting the webserver).
|
|||||||
Building locally requires ruby 2.5 and bundler. To install:
|
Building locally requires ruby 2.5 and bundler. To install:
|
||||||
|
|
||||||
```
|
```
|
||||||
gem install bundler
|
gem install bundler jekyll
|
||||||
bundle install
|
bundle
|
||||||
```
|
```
|
||||||
|
|
||||||
To run a local webserver:
|
To run a local webserver:
|
||||||
|
@ -2,56 +2,42 @@
|
|||||||
# Follow the pattern here for the URLs -- no slash at the beginning, and include the .html. The link here is rendered exactly as is in the Markdown references.
|
# Follow the pattern here for the URLs -- no slash at the beginning, and include the .html. The link here is rendered exactly as is in the Markdown references.
|
||||||
|
|
||||||
entries:
|
entries:
|
||||||
- product: Merlin 6
|
- product: Merlin
|
||||||
levels: one
|
version: 6
|
||||||
folders:
|
folders:
|
||||||
- title: Introduction
|
- title: Introduction
|
||||||
output: web
|
# URLs for top-level folders are optional. If omitted it is a bit easier to toggle the accordion.
|
||||||
|
#url: /merlin6/introduction.html
|
||||||
folderitems:
|
folderitems:
|
||||||
- title: Introduction
|
- title: Introduction
|
||||||
url: /merlin6/introduction.html
|
url: /merlin6/introduction.html
|
||||||
output: web
|
|
||||||
- title: Code Of Conduct
|
- title: Code Of Conduct
|
||||||
url: /merlin6/code-of-conduct.html
|
url: /merlin6/code-of-conduct.html
|
||||||
output: web
|
|
||||||
- title: Hardware And Software Description
|
- title: Hardware And Software Description
|
||||||
url: /merlin6/hardware-and-software.html
|
url: /merlin6/hardware-and-software.html
|
||||||
output: web
|
|
||||||
- title: Migrating From Merlin5
|
- title: Migrating From Merlin5
|
||||||
url: /merlin6/migrating.html
|
url: /merlin6/migrating.html
|
||||||
output: web
|
|
||||||
- title: Accessing Merlin
|
- title: Accessing Merlin
|
||||||
url: /merlin6/accessing-merlin6.html
|
url: /merlin6/accessing-merlin6.html
|
||||||
output: web
|
|
||||||
folderitems:
|
folderitems:
|
||||||
- title: Requesting Merlin6 Accounts
|
- title: Requesting Merlin6 Accounts
|
||||||
url: /merlin6/request-account.html
|
url: /merlin6/request-account.html
|
||||||
output: web
|
|
||||||
- title: Accessing Interactive Nodes
|
- title: Accessing Interactive Nodes
|
||||||
url: /merlin6/interactive.html
|
url: /merlin6/interactive.html
|
||||||
output: web
|
|
||||||
- title: Merlin6 Data Directories
|
- title: Merlin6 Data Directories
|
||||||
url: /merlin6/data-directories.html
|
url: /merlin6/data-directories.html
|
||||||
output: web
|
|
||||||
- title: Accessing Slurm Cluster
|
- title: Accessing Slurm Cluster
|
||||||
url: /merlin6/slurm-access.html
|
url: /merlin6/slurm-access.html
|
||||||
output: web
|
|
||||||
- title: Merlin6 Slurm
|
- title: Merlin6 Slurm
|
||||||
url: /merlin6/slurm.html
|
url: /merlin6/slurm.html
|
||||||
output: web
|
|
||||||
folderitems:
|
folderitems:
|
||||||
- title: Slurm Basic Commands
|
- title: Slurm Basic Commands
|
||||||
url: /merlin6/slurm-basics.html
|
url: /merlin6/slurm-basics.html
|
||||||
output: web
|
|
||||||
- title: Slurm Configuration
|
- title: Slurm Configuration
|
||||||
url: /merlin6/slurm-configuration.html
|
url: /merlin6/slurm-configuration.html
|
||||||
output: web
|
|
||||||
- title: Support
|
- title: Support
|
||||||
output: web
|
|
||||||
folderitems:
|
folderitems:
|
||||||
- title: Contact
|
- title: Contact
|
||||||
url: /merlin6/contact.html
|
url: /merlin6/contact.html
|
||||||
output: web
|
|
||||||
- title: Known Problems and Troubleshooting
|
- title: Known Problems and Troubleshooting
|
||||||
url: /merlin6/troubleshooting.html
|
url: /merlin6/troubleshooting.html
|
||||||
output: web
|
|
@ -3,12 +3,16 @@
|
|||||||
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version}}</li>
|
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version}}</li>
|
||||||
{% for entry in sidebar %}
|
{% for entry in sidebar %}
|
||||||
{% for folder in entry.folders %}
|
{% for folder in entry.folders %}
|
||||||
{% if folder.output contains "web" %}
|
{% if folder.output == nil or folder.output contains "web"%}
|
||||||
|
{% if folder.url != nil and page.url contains folder.url %}
|
||||||
|
<li class = "active" >
|
||||||
|
{% else %}
|
||||||
<li>
|
<li>
|
||||||
<a title="{{folder.title}}" href="#">{{folder.title}}</a>
|
{% endif %}
|
||||||
|
<a title="{{folder.title}}" href="{{folder.url | default:"#" }}">{{folder.title}}</a>
|
||||||
<ul>
|
<ul>
|
||||||
{% for folderitem in folder.folderitems %}
|
{% for folderitem in folder.folderitems %}
|
||||||
{% if folderitem.output contains "web" %}
|
{% if folderitem.output == nil or folderitem.output contains "web" %}
|
||||||
{% if folderitem.external_url %}
|
{% if folderitem.external_url %}
|
||||||
<li><a title="{{folderitem.title}}" href="{{folderitem.external_url}}" target="_blank" rel="noopener">{{folderitem.title}}</a></li>
|
<li><a title="{{folderitem.title}}" href="{{folderitem.external_url}}" target="_blank" rel="noopener">{{folderitem.title}}</a></li>
|
||||||
{% elsif page.url contains folderitem.url %}
|
{% elsif page.url contains folderitem.url %}
|
||||||
@ -20,12 +24,12 @@
|
|||||||
<li><a title="{{folderitem.title}}" href="{{folderitem.url | relative_url}}">{{folderitem.title}}</a></li>
|
<li><a title="{{folderitem.title}}" href="{{folderitem.url | relative_url}}">{{folderitem.title}}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for subfolders in folderitem.subfolders %}
|
{% for subfolders in folderitem.subfolders %}
|
||||||
{% if subfolders.output contains "web" %}
|
{% if subfolders.output == nil or subfolders.output contains "web" %}
|
||||||
<li class="subfolders">
|
<li class="subfolders">
|
||||||
<a title="{{subfolders.title}}" href="#">{{ subfolders.title }}</a>
|
<a title="{{subfolders.title}}" href="{{subfolders.url | default:"#" }}">{{ subfolders.title }}</a>
|
||||||
<ul>
|
<ul>
|
||||||
{% for subfolderitem in subfolders.subfolderitems %}
|
{% for subfolderitem in subfolders.subfolderitems %}
|
||||||
{% if subfolderitem.output contains "web" %}
|
{% if subfolderitem.output == nil or subfolderitem.output contains "web" %}
|
||||||
{% if subfolderitem.external_url %}
|
{% if subfolderitem.external_url %}
|
||||||
<li><a title="{{subfolderitem.title}}" href="{{subfolderitem.external_url}}" target="_blank" rel="noopener">{{subfolderitem.title}}</a></li>
|
<li><a title="{{subfolderitem.title}}" href="{{subfolderitem.external_url}}" target="_blank" rel="noopener">{{subfolderitem.title}}</a></li>
|
||||||
{% elsif page.url == subfolderitem.url %}
|
{% elsif page.url == subfolderitem.url %}
|
||||||
@ -60,4 +64,4 @@ appear below the sidebar code above. Otherwise, if placed inside
|
|||||||
customscripts.js, the script runs before the sidebar code runs and the
|
customscripts.js, the script runs before the sidebar code runs and the
|
||||||
class never gets inserted.
|
class never gets inserted.
|
||||||
-->
|
-->
|
||||||
<script>$("li.active").parents('li').toggleClass("active");</script>
|
<script>$("li.active").parents('li').addClass("active");</script>
|
||||||
|
Reference in New Issue
Block a user