Skip to content

Commit

Permalink
fixes #115
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed May 26, 2019
1 parent 1d91c32 commit 8f5da89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

1. [](#bugfix)
* Fixed issue with Prism Highlight [prism-highlight#1](https://github.com/trilbymedia/grav-plugin-prism-highlight/issues/1)
* Use slug for onpage links [#115](https://github.com/getgrav/grav-theme-quark/issues/115)

# v2.0.1
## 05/09/2019
Expand Down
10 changes: 3 additions & 7 deletions templates/modular.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{% extends 'partials/base.html.twig' %}

{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}

{% import _self as macro %}

{% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}

{% block javascripts %}
Expand Down Expand Up @@ -33,7 +29,7 @@
<ul class="navigation">
{% for module in page.collection() if module.header.visible is not same as(false) %}
{% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
<li><a class="{{ current_module }}" href="#{{ macro.pageLinkName(module.menu) }}">{{ module.menu }}</a></li>
<li><a class="{{ current_module }}" href="#{{ module.menu|hyphenize }}">{{ module.menu }}</a></li>
{% endfor %}
{% for mitem in site.menu %}
<li>
Expand All @@ -51,14 +47,14 @@

{% block hero %}
{% for module in page.collection() if module.template == 'modular/hero' %}
<div id="{{ macro.pageLinkName(module.menu) }}"></div>
<div id="{{ module.menu|hyphenize }}"></div>
{{ module.content|raw }}
{% endfor %}
{% endblock %}

{% block body %}
{% for module in page.collection() if module.template != 'modular/hero' %}
<div id="{{ macro.pageLinkName(module.menu) }}"></div>
<div id="{{ module.menu|hyphenize }}"></div>
{{ module.content|raw }}
{% endfor %}
{% endblock %}

0 comments on commit 8f5da89

Please sign in to comment.