Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions _data/tutorial_sidebar_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# _data/tutorial_sidebar_config.yml
# ===================================
# Single source of truth for tutorial sidebar navigation decisions.
# Lives in the MAIN SITE REPO (_data/), never in the tutorials submodule.
#
# HUGO MIGRATION:
# Read via $.Site.Data.tutorial_sidebar_config — identical structure.
# Only the template syntax changes, not this file.
#
# TITLE OVERRIDES:
# Both `featured` entries and group `permalinks` support an optional `title`
# field. If present it overrides the verbose README title with a short display
# name matching the original tutorial_sidebar.yml. If absent, the template
# falls back to the page's own `title` front matter.
#
# ADDING A NEW TUTORIAL:
# - Appears in "All tutorials" automatically with no changes here.
# - To feature it in Basic cases: add an entry under `featured`.
# - To put it in a named group: add an entry under the group's `permalinks`.
# - To create a new group: add a new block under `groups`.

# ------------------------------------------------------------------------------
# Basic cases
# Rendered in ascending `order`. Title overrides the README title if present.
# ------------------------------------------------------------------------------
featured:
- permalink: quickstart.html
order: 1
title: Quickstart
- permalink: tutorials-flow-over-heated-plate.html
order: 2
title: Flow over a heated plate
- permalink: tutorials-partitioned-heat-conduction.html
order: 3
title: Partitioned heat conduction
- permalink: tutorials-perpendicular-flap.html
order: 4
title: Perpendicular flap

# ------------------------------------------------------------------------------
# Subgroups
# Each group becomes a collapsible sub-folder in "All tutorials".
# Groups and flat pages are interleaved alphabetically by display name —
# the `name` field is used as the sort key alongside flat page titles.
# `order` is NOT used for positioning within All tutorials (alphabetical
# interleaving handles that). `order` is kept for potential future use
# and documents editorial intent.
# Pages within each group are sorted alphabetically by their display title.
# ------------------------------------------------------------------------------
groups:
- name: Channel transport
order: 1
permalinks:
- url: tutorials-channel-transport.html
title: Basic variant
- url: tutorials-channel-transport-reaction.html
title: Reaction
- url: tutorials-channel-transport-particles.html
title: Particles

- name: Flow over a heated plate
order: 2
permalinks:
- url: tutorials-flow-over-heated-plate.html
title: Basic variant
- url: tutorials-flow-over-heated-plate-nearest-projection.html
title: Nearest-projection mapping
- url: tutorials-flow-over-heated-plate-steady-state.html
title: Steady state
- url: tutorials-flow-over-heated-plate-two-meshes.html
title: Two meshes

- name: Partitioned flow
order: 3
permalinks:
- url: tutorials-partitioned-backwards-facing-step.html
title: Partitioned flow over a b.f. step
- url: tutorials-flow-over-heated-plate-partitioned-flow.html
title: Partitioned flow over heated plate
- url: tutorials-partitioned-pipe.html
title: Partitioned pipe
- url: tutorials-partitioned-pipe-two-phase.html
title: Partitioned pipe two-phase

- name: Partitioned heat conduction
order: 4
permalinks:
- url: tutorials-partitioned-heat-conduction.html
title: Basic variant
- url: tutorials-partitioned-heat-conduction-complex.html
title: Complex variant
- url: tutorials-partitioned-heat-conduction-direct.html
title: Direct mesh access
- url: tutorials-partitioned-heat-conduction-overlap.html
title: Overlapping Schwarz

- name: Perpendicular flap
order: 5
permalinks:
- url: tutorials-perpendicular-flap.html
title: Basic variant
- url: tutorials-perpendicular-flap-stress.html
title: Stress variant
181 changes: 113 additions & 68 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,74 +1,119 @@
{% assign sidebar = site.data.sidebars[page.sidebar].entries %}
{% if page.sidebar == 'tutorial_sidebar' %}
{% include tutorial_sidebar.html %}
{% else %}
{% assign sidebar = site.data.sidebars[page.sidebar].entries %}

<nav aria-label="{{sidebar[0].product}}">
<ul id="mysidebar" class="nav">
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version}}</li>
{% for entry in sidebar %}
{% for folder in entry.folders %}
{% if folder.output contains "web" %}
{% if folder.url %}
<!-- Parent menu item has url and no folderitems -->
{% if page.url == folder.url %}
<li class="active">
<a title="{{folder.title}}" href="{{folder.url | remove: "/"}}">{{folder.title}}</a>
</li>
{% else %}
<li>
<a title="{{folder.title}}" href="{{folder.url | remove: "/"}}">{{folder.title}}</a>
</li>
{% endif %}
{% else %}
<!-- Parent menu item has folderitems -->
<li>
<a title="{{folder.title}}" href="#">{{folder.title}}</a>
<ul>
{% for folderitem in folder.folderitems %}
{% if folderitem.output contains "web" %}
{% if folderitem.external_url %}
<li><a title="{{folderitem.title}}" href="{{folderitem.external_url}}" target="_blank" rel="noopener">{{folderitem.title}}</a></li>
{% elsif page.url == folderitem.url %}
<li {% if folderitem.link-only == nil or folderitem.link-only == false %} class="active" {% endif %} ><a title="{{folderitem.title}}" href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>
{% elsif folderitem.type == "empty" %}
<li><a title="{{folderitem.title}}" href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>
<nav aria-label="{{sidebar[0].product}}">
<ul id="mysidebar" class="nav">
<li class="sidebarTitle">
{{ sidebar[0].product }}
{{ sidebar[0].version }}
</li>
{% for entry in sidebar %}
{% for folder in entry.folders %}
{% if folder.output contains 'web' %}
{% if folder.url %}
<!-- Parent menu item has url and no folderitems -->
{% if page.url == folder.url %}
<li class="active">
<a title="{{folder.title}}" href="{{folder.url | remove: "/"}}">{{ folder.title }}</a>
</li>
{% else %}
<li>
<a title="{{folder.title}}" href="{{folder.url | remove: "/"}}">{{ folder.title }}</a>
</li>
{% endif %}
{% else %}
<!-- Parent menu item has folderitems -->
<li>
<a title="{{folder.title}}" href="#">{{ folder.title }}</a>
<ul>
{% for folderitem in folder.folderitems %}
{% if folderitem.output contains 'web' %}
{% if folderitem.external_url %}
<li>
<a
title="{{folderitem.title}}"
href="{{folderitem.external_url}}"
target="_blank"
rel="noopener"
>
{{- folderitem.title -}}
</a>
</li>
{% elsif page.url == folderitem.url %}
<li
{% if folderitem['link-only'] == null or folderitem['link-only'] == false %}
class="active"
{% endif %}
>
<a title="{{folderitem.title}}" href="{{folderitem.url | remove: "/"}}">
{{- folderitem.title -}}
</a>
</li>
{% elsif folderitem.type == 'empty' %}
<li>
<a title="{{folderitem.title}}" href="{{folderitem.url | remove: "/"}}">
{{- folderitem.title -}}
</a>
</li>

{% else %}
<li><a title="{{folderitem.title}}" href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>
{% endif %}
{% for subfolders in folderitem.subfolders %}
{% if subfolders.output contains "web" %}
<li class="subfolders">
<a title="{{subfolders.title}}" href="#">{{ subfolders.title }}</a>
<ul>
{% for subfolderitem in subfolders.subfolderitems %}
{% if subfolderitem.output contains "web" %}
{% if subfolderitem.external_url %}
<li><a title="{{subfolderitem.title}}" href="{{subfolderitem.external_url}}" target="_blank" rel="noopener">{{subfolderitem.title}}</a></li>
{% elsif page.url == subfolderitem.url %}
<li class="active"><a title="{{subfolderitem.title}}" href="{{subfolderitem.url | remove: "/"}}">{{subfolderitem.title}}</a></li>
{% else %}
<li><a title="{{subfolderitem.title}}" href="{{subfolderitem.url | remove: "/"}}">{{subfolderitem.title}}</a></li>
{% endif %}
{% else %}
<li>
<a title="{{folderitem.title}}" href="{{folderitem.url | remove: "/"}}">
{{- folderitem.title -}}
</a>
</li>
{% endif %}
{% for subfolders in folderitem.subfolders %}
{% if subfolders.output contains 'web' %}
<li class="subfolders">
<a title="{{subfolders.title}}" href="#">{{ subfolders.title }}</a>
<ul>
{% for subfolderitem in subfolders.subfolderitems %}
{% if subfolderitem.output contains 'web' %}
{% if subfolderitem.external_url %}
<li>
<a
title="{{subfolderitem.title}}"
href="{{subfolderitem.external_url}}"
target="_blank"
rel="noopener"
>
{{- subfolderitem.title -}}
</a>
</li>
{% elsif page.url == subfolderitem.url %}
<li class="active">
<a title="{{subfolderitem.title}}" href="{{subfolderitem.url | remove: "/"}}">
{{- subfolderitem.title -}}
</a>
</li>
{% else %}
<li>
<a title="{{subfolderitem.title}}" href="{{subfolderitem.url | remove: "/"}}">
{{- subfolderitem.title -}}
</a>
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</li>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
<!-- if you aren't using the accordion, uncomment this block:
<p class="external">
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
</p>
-->
</ul>
</nav>
</nav>

<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
<script>$("li.active").parents('li').toggleClass("active");</script>
<script>
$('li.active').parents('li').toggleClass('active');
</script>
{% endif %}
Loading