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

Alter section headers to be anchor tags rather than headers #3416

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
15 changes: 9 additions & 6 deletions src/components/section-navigation/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@
class="ons-section-nav__item{{ ' ' + item.classes if item.classes else '' }}{{ ' ons-section-nav__item--active' if isCurrent == true }}"
>
{% if isCurrent == true %}
{{ openingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
class="ons-section-nav__link ons-section-nav__item-header" href="{{ item.url }}"
aria-current="location">{{ item.text }}{{ closingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
<a
class="ons-section-nav__link ons-section-nav__item-header"
href="{{ item.url }}"
aria-current="location"
>{{ item.text }}</a
>
{% else %}
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.text }}</a>
{% endif %}
Expand Down Expand Up @@ -71,9 +74,9 @@
class="ons-section-nav__item{{ ' ' + item.classes if item.classes else '' }}{% if isCurrent == true %}{{ ' ' }}ons-section-nav__item--active{% endif %}"
>
{% if isCurrent == true %}
{{ openingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
class="ons-section-nav__link ons-section-nav__item-header" href="{{ item.url }}"
aria-current="location">{{ item.text }}{{ closingHeadingTag | replace(headingLevel, sectionItemHeadingLevel | string) | safe }}
<a class="ons-section-nav__link ons-section-nav__item-header" href="{{ item.url }}" aria-current="location"
>{{ item.text }}</a
>
{% else %}
<a class="ons-section-nav__link" href="{{ item.url }}">{{ item.text }}</a>
{% endif %}
Expand Down