Skip to content
Snippets Groups Projects
Commit c50a6dcd authored by malthefogsporring's avatar malthefogsporring
Browse files

Fix an issue where search bar didn't show on online docs. This is fixed...

Fix an issue where search bar didn't show on online docs. This is fixed permanently by only installing the current version of mkdocs-material, so future updates do not break out code.

Fix an issue where styles.css was not accessible to the website, by changing from combinatronics to jsdelivr as service for accessing the raw css file hosted on github.
parent 41536c01
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ jobs: ...@@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: 3.x python-version: 3.x
- run: pip install mkdocs-material - run: pip install mkdocs-material==9.0.3
- run: pip install https://github.com/mitya57/python-markdown-math/archive/master.zip - run: pip install https://github.com/mitya57/python-markdown-math/archive/master.zip
- run: pip install mkdocs-exclude - run: pip install mkdocs-exclude
- run: pip install mkdocs-redirects - run: pip install mkdocs-redirects
......
...@@ -15,7 +15,7 @@ theme: ...@@ -15,7 +15,7 @@ theme:
docs_dir: 'doc' docs_dir: 'doc'
extra_css: extra_css:
- custom.css - custom.css
- https://combinatronics.com/maths/moodle-qtype_stack/master/styles.css - 'https://cdn.jsdelivr.net/gh/maths/moodle-qtype_stack@master/styles.css'
markdown_extensions: markdown_extensions:
- mdx_math - mdx_math
- extra - extra
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
</label> </label>
<!--Make site title permament --> <!--Make site title permament -->
<div class="md-header__title" data-md-component="header-title"> <div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis md-header__topic md-ellipsis"> <div class="md-header__ellipsis md-ellipsis">
{{ config.site_name }} <b>{{ config.site_name }}</b>
</div> </div>
</div> </div>
{% if "search" in config["plugins"] %} {% if "material/search" in config.plugins %}
<label class="md-header__button md-icon" for="__search"> <label class="md-header__button md-icon" for="__search">
{% include ".icons/material/magnify.svg" %} {% include ".icons/material/magnify.svg" %}
</label> </label>
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
{% if nav_item.active %} {% if nav_item.active %}
{% set class = class ~ " md-nav__item--active" %} {% set class = class ~ " md-nav__item--active" %}
{% endif %} {% endif %}
<!--Skip first level in the navigation bar, i.e. the "En" level--> <!--Skip first level in the navigation bar, i.e. the "En" level-->
{%if nav_item.title == "En"%} {%if nav_item.title == "En"%}
{% set base = path %} {% set base = path %}
...@@ -20,17 +19,39 @@ ...@@ -20,17 +19,39 @@
{% set class = class ~ " md-nav__item--section" %} {% set class = class ~ " md-nav__item--section" %}
{% endif %} {% endif %}
<li class="{{ class }} md-nav__item--nested"> <li class="{{ class }} md-nav__item--nested">
{% set expanded = "navigation.expand" in features %}
{% set active = nav_item.active or expanded %}
{% set checked = "checked" if nav_item.active %} {% set checked = "checked" if nav_item.active %}
{% if "navigation.expand" in features and not checked %} {% if expanded and not checked %}
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" {% set indeterminate = "md-toggle--indeterminate" %}
data-md-state="indeterminate" type="checkbox" id="{{ path }}" checked> {% endif %}
{% else %} <input class="md-nav__toggle md-toggle {{ indeterminate }}" data-md-toggle="{{ path }}"
<input class="md-nav__toggle md-toggle" data-md-toggle="{{ path }}" type="checkbox" id="{{ path }}" {{ checked }}> type="checkbox" id="{{ path }}" {{ checked }}>
{% set indexes = [] %}
{% if "navigation.indexes" in features %}
{% for nav_item in nav_item.children %}
{% if nav_item.is_index and not index is defined %}
{% set _ = indexes.append(nav_item) %}
{% endif %} {% endif %}
<label class="md-nav__link" for="{{ path }}"> {% endfor %}
{% endif %}
{% if not indexes %}
<label class="md-nav__link" for="{{ path }}" tabindex="0" aria-expanded="{{ nav_item.active | tojson }}">
{{ nav_item.title }} {{ nav_item.title }}
<span class="md-nav__icon md-icon"></span> <span class="md-nav__icon md-icon"></span>
</label> </label>
{% else %}
{% set index = indexes | first %}
{% set class = "md-nav__link--active" if index == page %}
<div class="md-nav__link md-nav__link--index {{ class }}">
<a href="{{ index.url | url }}">{{ nav_item.title }}</a>
{% if nav_item.children | length > 1 %}
<label for="{{ path }}">
<span class="md-nav__icon md-icon"></span>
</label>
{% endif %}
</div>
{% endif %}
<nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}"> <nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}">
<label class="md-nav__title" for="{{ path }}"> <label class="md-nav__title" for="{{ path }}">
<span class="md-nav__icon md-icon"></span> <span class="md-nav__icon md-icon"></span>
...@@ -38,7 +59,9 @@ ...@@ -38,7 +59,9 @@
</label> </label>
<ul class="md-nav__list" data-md-scrollfix> <ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav_item.children %} {% for nav_item in nav_item.children %}
{% if not indexes or nav_item != indexes | first %}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }} {{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment