test mkdocs
This commit is contained in:
13
cz/macros/prev-next.j2
Normal file
13
cz/macros/prev-next.j2
Normal file
@ -0,0 +1,13 @@
|
||||
{% macro make_prev_next( ) -%}
|
||||
<nav class="btn-group">
|
||||
{%- if page.previous_page %}
|
||||
<a href="{{ page.previous_page.url|url }}" title="{{ page.previous_page.title }}">{% trans %}Previous{% endtrans %}</a>
|
||||
{% endif %}
|
||||
{%- if page.previous_page and page.next_page -%}
|
||||
|
|
||||
{%- endif -%}
|
||||
{%- if page.next_page %}
|
||||
<a href="{{ page.next_page.url|url }}" title="{{ page.next_page.title }}">{% trans %}Next{% endtrans %}</a>
|
||||
{%- endif %}
|
||||
</nav>
|
||||
{%- endmacro -%}
|
3
cz/macros/side-nav/section-index-page-title.j2
Normal file
3
cz/macros/side-nav/section-index-page-title.j2
Normal file
@ -0,0 +1,3 @@
|
||||
{% macro get_section_index_page_title() -%}
|
||||
{% if config.extra.INDEX_PAGE_NAV_TITLE %}{{ config.extra.INDEX_PAGE_NAV_TITLE }}{% else %}Index{% endif %}
|
||||
{%- endmacro -%}
|
41
cz/macros/side-nav/side-nav-item-class.j2
Normal file
41
cz/macros/side-nav/side-nav-item-class.j2
Normal file
@ -0,0 +1,41 @@
|
||||
{% import 'macros/side-nav/section-index-page-title.j2' as index_helper with context %}
|
||||
|
||||
{% macro get_base_class( nav_item ) -%}
|
||||
{% set ns = namespace(class="terminal-mkdocs-side-nav-item", is_active_index=false) %}
|
||||
{% if nav_item.active %}
|
||||
{%- set ns.class = ns.class ~ "--active" -%}
|
||||
{% endif %}
|
||||
|
||||
{% if "navigation.side.indexes" in features and nav_item.title == index_helper.get_section_index_page_title() %}
|
||||
{# if nav_item is a index page, check to see if any of its' siblings are active) #}
|
||||
{% for index_sibling in nav_item.parent.children %}
|
||||
{% if index_sibling.active %}
|
||||
{% set ns.is_active_index = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if ns.is_active_index %}
|
||||
{%- set ns.class = ns.class ~ "--active" -%}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{{ ns.class|trim }}
|
||||
{%- endmacro -%}
|
||||
|
||||
|
||||
{# 'terminal-mkdocs-side-nav-section-no-index' css class used to indicate a non-clickable folder #}
|
||||
{% macro get_class( nav_item ) -%}
|
||||
{% set ns = namespace(class="") %}
|
||||
{%- set ns.class = get_base_class( nav_item ) -%}
|
||||
|
||||
{% if nav_item.children %}
|
||||
{% if "navigation.side.indexes" not in features %}
|
||||
{%- set ns.class = ns.class ~ " terminal-mkdocs-side-nav-section-no-index" -%}
|
||||
{% else %}
|
||||
{% if nav_item.children|selectattr("title", "eq", index_helper.get_section_index_page_title() )|list|length == 0 %}
|
||||
{%- set ns.class = ns.class ~ " terminal-mkdocs-side-nav-section-no-index" -%}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{{ ns.class|trim }}
|
||||
{%- endmacro -%}
|
23
cz/macros/side-nav/side-nav-item.j2
Normal file
23
cz/macros/side-nav/side-nav-item.j2
Normal file
@ -0,0 +1,23 @@
|
||||
{% macro index_item( nav_item, class ) -%}
|
||||
{% if nav_item.active %}
|
||||
<span {% if class %}class="{{ class }}"{% endif %}>{{ nav_item.parent.title }}</span>
|
||||
{% else %}
|
||||
<a {% if class %}class="{{ class }}"{% endif %} href="{{ nav_item.url|url }}">{{ nav_item.parent.title }}</a>
|
||||
{% endif %}
|
||||
{%- endmacro -%}
|
||||
|
||||
|
||||
|
||||
{% macro non_index_item( nav_item, class ) -%}
|
||||
{% if nav_item.active %}
|
||||
<span {% if class %}class="{{ class }}"{% endif %}>{{ nav_item.title }}</span>
|
||||
{% else %}
|
||||
{% if nav_item.is_section %}
|
||||
{# nav_item.is_section covers MkDocs Section objects #}
|
||||
{# MkDocs Section objects do not have a URL to use as a link #}
|
||||
<span {% if class %}class="{{ class }}"{% endif %}>{{ nav_item.title }}</span>
|
||||
{% else %}
|
||||
<a {% if class %}class="{{ class }}"{% endif %} href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{%- endmacro -%}
|
12
cz/macros/toc.j2
Normal file
12
cz/macros/toc.j2
Normal file
@ -0,0 +1,12 @@
|
||||
{% macro make_toc( toc ) -%}
|
||||
<nav>
|
||||
<ul>
|
||||
{% for toc_item in toc -%}
|
||||
<li><a href="{{ toc_item.url }}">{{ toc_item.title}}</a></li>
|
||||
{% for toc_item in toc_item.children -%}
|
||||
<li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
|
||||
{%- endfor %}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{%- endmacro -%}
|
9
cz/macros/top-nav/search-button.j2
Normal file
9
cz/macros/top-nav/search-button.j2
Normal file
@ -0,0 +1,9 @@
|
||||
{% macro make_search_button( idx_in_menu ) %}
|
||||
{% set search_button_ns = namespace(text="Search") %}
|
||||
<li property="itemListElement" typeof="ListItem">
|
||||
<a href="#" class="menu-item" data-toggle="modal" data-target="#mkdocs_search_modal" property="item" typeof="SearchAction">
|
||||
<i aria-hidden="true" class="fa fa-search"></i> <span property="name">{{ search_button_ns.text }}</span>
|
||||
</a>
|
||||
<meta property="position" content="{{ idx_in_menu }}">
|
||||
</li>
|
||||
{%- endmacro -%}
|
Reference in New Issue
Block a user