{% assign urlParts = page.url | split: '/' %} {% assign activePlatform = urlParts[1] %} {% assign platform = site.data.routes.platforms | where: "href", activePlatform | first %} {% assign activeHub = urlParts[3] %} {% assign hub = platform.hubs | where: "href", activeHub | first %} {% assign hubPrefix = "/" | append: activePlatform | append: "/hubs/" | append: activeHub | append: "/" %} {% assign activeSectionPath = page.url | replace: ".html", "" | replace: hubPrefix, "" %} {% assign section = hub.flatSections | where: "href", activeSectionPath | first %}