Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active doc page highlighted #314

Merged
merged 1 commit into from
Jun 26, 2019
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
11 changes: 8 additions & 3 deletions src/main/scala/microsites/layouts/DocsLayout.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,20 @@ class DocsLayout(config: MicrositeSettings) extends Layout(config) {
"{% if site.data.menu.options %}",
"{% assign items = site.data.menu.options %}",
"{% for x in items %} ",
"{% assign x_title = x.title | downcase %}",
"{% assign page_title = page.title | downcase %}",
"{% if x.menu_type.size == false or x.menu_type == page.section %}",
li(
a(href := "{{ site.baseurl }}/{{ x.url }}",
cls := "{% if x.title == page.title %} active {% endif %}", "{{x.title}}"),
cls := "{% if x_title == page_title %} active {% endif %}", "{{x.title}}"),
"{% if x.nested_options %} ",
ul(
cls := "sub_section",
"{% for sub in x.nested_options %} ",
"{% assign sub_title = sub.title | downcase %}",
li(
a(href := "{{ site.baseurl }}/{{ sub.url }}",
cls := "{% if sub.title == page.title and x.section == sub.section %} active {% endif %}",
cls := "{% if sub_title == page_title and x.section == sub.section %} active {% endif %}",
"{{sub.title}}"
)
),
Expand All @@ -131,11 +134,13 @@ class DocsLayout(config: MicrositeSettings) extends Layout(config) {
"{% else %}",
"{% assign items = site.pages | sort: 'weight' %}",
"{% for x in items %}",
"{% assign x_title = x.title | downcase %}",
"{% assign page_title = page.title | downcase %}",
"{% if x.section == page.section %}",
li(
a(
href := "{{ site.baseurl }}{{x.url}}",
cls := "{% if x.title == page.title %} active {% endif %}",
cls := "{% if x_title == page_title %} active {% endif %}",
"{{x.title}}"
)
),
Expand Down