Merge pull request #6 from LASSAT-YU/master
Added functionality and stopped undesirable behaviour
This commit is contained in:
commit
605c8917e3
3 changed files with 147 additions and 113 deletions
|
@ -11,3 +11,4 @@ highlight_theme = "base16-ocean-light"
|
|||
logo = "https://easydocs.codeandmedia.com/logo.svg"
|
||||
release = "https://api.github.com/repos/getzola/zola/releases/latest"
|
||||
favicon = "https://www.getzola.org/favicon.ico"
|
||||
easydocs_logo_always_clickable = false
|
|
@ -4,7 +4,11 @@
|
|||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="{{ get_url(path="main.css") | safe }}">
|
||||
{% if config.extra.favicon %}
|
||||
<link rel="icon" href="{{ config.extra.favicon | safe }}">
|
||||
{% set _favicon = config.extra.favicon %}
|
||||
{% if (_favicon is starting_with("http")) == false %}
|
||||
{% set _favicon = get_url(path=config.extra.favicon) %}
|
||||
{% endif %}
|
||||
<link rel="icon" href="{{ _favicon | safe }}">
|
||||
{% endif %}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
|
||||
|
@ -30,11 +34,14 @@
|
|||
|
||||
<nav>
|
||||
{% if config.extra.logo %}
|
||||
{% if current_path == "/" %}
|
||||
<img src="{{ config.extra.logo | safe }}" alt="" />
|
||||
|
||||
{% set _logo = config.extra.logo %}
|
||||
{% if (_logo is starting_with("http")) == false %}
|
||||
{% set _logo = get_url(path=config.extra.logo) %}
|
||||
{% endif %}
|
||||
{% if current_path == "/" and not config.extra.easydocs_logo_always_clickable %}
|
||||
<img src="{{ _logo | safe }}" alt=""/>
|
||||
{% else %}<a href="{{ config.base_url }}">
|
||||
<img src="{{ config.extra.logo | safe }}" alt="" />
|
||||
<img src="{{ _logo | safe }}" alt=""/>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
|
@ -48,14 +55,15 @@
|
|||
|
||||
<a href="javascript:void(0);" onclick="burger()" id="mobile" class="ms-Icon--GlobalNavButton"></a>
|
||||
<div id="trees">
|
||||
{% set section = get_section(path="_index.md") %}
|
||||
{% for p in section.subsections %}
|
||||
{% set section_ = get_section(path="_index.md") %}
|
||||
{% for p in section_.subsections %}
|
||||
{% set subsection = get_section(path=p) %}
|
||||
|
||||
|
||||
<input class="tree-toggle" type="checkbox" id="{{ subsection.title | slugify }}"
|
||||
{% if current_path is starting_with(subsection.path) %}checked{% endif %}/>
|
||||
<label class="tree-toggle-label" for="{{ subsection.title | slugify }}">{{ subsection.title }}</label>
|
||||
<label class="tree-toggle-label"
|
||||
for="{{ subsection.title | slugify }}">{{ subsection.title }}</label>
|
||||
|
||||
<ul class="subtree">
|
||||
{% for page in subsection.pages %}
|
||||
|
@ -85,7 +93,9 @@
|
|||
{% if h2.children %}
|
||||
<ul>
|
||||
{% for h3 in h2.children %}
|
||||
<li><a href="{{ h3.permalink | safe }}">{{ h3.title }}</a></li>
|
||||
<li>
|
||||
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
|
23
templates/section.html
Normal file
23
templates/section.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% extends "index.html" %}
|
||||
|
||||
{% block title %} {{ config.title }} | {{ section.title }} {% endblock title %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% if section.word_count > 0 %}
|
||||
{{ section.content }}
|
||||
{% else %}
|
||||
<h1 class="title">
|
||||
{{ section.title }}
|
||||
</h1>
|
||||
Pages:
|
||||
<ul>
|
||||
{% for page in section.pages %}
|
||||
<li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue