From 9a7b8710bac221d46c69c4064b6cefba6ebc3f34 Mon Sep 17 00:00:00 2001 From: Spencer Bliven Date: Mon, 17 Jun 2019 11:40:04 +0200 Subject: [PATCH] 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. --- README.md | 4 ++-- _data/sidebars/merlin6_sidebar.yml | 22 ++++------------------ _includes/sidebar.html | 18 +++++++++++------- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index d887360..86cef4b 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ to _config.yml, which requires restarting the webserver). Building locally requires ruby 2.5 and bundler. To install: ``` -gem install bundler -bundle install +gem install bundler jekyll +bundle ``` To run a local webserver: diff --git a/_data/sidebars/merlin6_sidebar.yml b/_data/sidebars/merlin6_sidebar.yml index bb9c95f..5c66125 100644 --- a/_data/sidebars/merlin6_sidebar.yml +++ b/_data/sidebars/merlin6_sidebar.yml @@ -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. entries: -- product: Merlin 6 - levels: one +- product: Merlin + version: 6 folders: - 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: - title: Introduction url: /merlin6/introduction.html - output: web - title: Code Of Conduct url: /merlin6/code-of-conduct.html - output: web - title: Hardware And Software Description url: /merlin6/hardware-and-software.html - output: web - title: Migrating From Merlin5 url: /merlin6/migrating.html - output: web - title: Accessing Merlin url: /merlin6/accessing-merlin6.html - output: web folderitems: - title: Requesting Merlin6 Accounts url: /merlin6/request-account.html - output: web - title: Accessing Interactive Nodes url: /merlin6/interactive.html - output: web - title: Merlin6 Data Directories url: /merlin6/data-directories.html - output: web - title: Accessing Slurm Cluster url: /merlin6/slurm-access.html - output: web - title: Merlin6 Slurm url: /merlin6/slurm.html - output: web folderitems: - title: Slurm Basic Commands url: /merlin6/slurm-basics.html - output: web - title: Slurm Configuration url: /merlin6/slurm-configuration.html - output: web - title: Support - output: web folderitems: - title: Contact url: /merlin6/contact.html - output: web - title: Known Problems and Troubleshooting url: /merlin6/troubleshooting.html - output: web \ No newline at end of file diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 71e7d6d..d83892e 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -3,12 +3,16 @@
  • {{sidebar[0].product}} {{sidebar[0].version}}
  • {% for entry in sidebar %} {% 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 %} +
  • + {% else %}
  • - {{folder.title}} + {% endif %} + {{folder.title}}