Skip to content
Merged
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
25 changes: 1 addition & 24 deletions docs/_includes/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,10 @@
{% assign activeHub = urlParts[3] %}
{% assign hub = platform.hubs | where: "href", activeHub | first %}

{% comment %} Build section path from URL (e.g. netsuite or netsuite/Troubleshooting) {% endcomment %}
{% assign hubPrefix = "/" | append: activePlatform | append: "/hubs/" | append: activeHub | append: "/" %}
{% assign activeSectionPath = page.url | replace: ".html", "" | replace: hubPrefix, "" %}
{% assign sectionParts = activeSectionPath | split: "/" %}

{% assign topSectionHref = sectionParts[0] %}
{% assign section = hub.sections | where: "href", topSectionHref | first %}

{% if section == nil %}
{% assign section = hub.sections | where: "href", activeSectionPath | first %}
{% endif %}

{% if section and section.href != activeSectionPath and section.sections %}
{% assign nestedSection = section.sections | where: "href", activeSectionPath | first %}
{% if nestedSection %}
{% assign section = nestedSection %}
{% endif %}
{% endif %}

{% if section and section.href != activeSectionPath and section.sections %}
{% for child in section.sections %}
{% assign nestedSection = child.sections | where: "href", activeSectionPath | first %}
{% if nestedSection %}
{% assign section = nestedSection %}
{% endif %}
{% endfor %}
{% endif %}
{% assign section = hub.flatSections | where: "href", activeSectionPath | first %}

<h1 class="title">
{{ section.title }}
Expand Down
Loading