husk/templates/template.html

96 lines
3.4 KiB
HTML
Raw Normal View History

2022-09-02 09:05:59 +02:00
<!doctype html>
<html lang="en">
<center>
<head>
{% block head %}
<script src="https://cdn.jsdelivr.net/npm/fuse.js/dist/fuse.js"></script>
2022-09-06 23:45:26 +02:00
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/auto-complete.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/lunr.min.js')}}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/search.js')}}"></script>
2022-09-02 09:05:59 +02:00
<link rel="stylesheet" href="{{ url_for('static', filename='stylesheet.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='auto-complete.css') }}">
<br>
<title>{% block title %}The Real Hugo{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
{% endblock %}
</head>
2022-09-24 20:06:27 +02:00
2022-09-18 21:00:35 +02:00
<body class="HolyGrail">
<header>
2022-09-02 09:05:59 +02:00
<div class="menu">
2022-09-06 23:45:26 +02:00
<a href="{{ url_for('content') }}" style="text-decoration:none">Husk</a>
2022-09-02 09:05:59 +02:00
</div>
<div class="search-container">
<label for="search-by"><i class="fas fa-search"></i></label>
2022-09-25 15:23:58 +02:00
<input data-search-input="" id="search-by" type="search" placeholder="Search..." autocomplete="off">
2022-09-02 09:05:59 +02:00
<!--button type="submit"><i class="search"></i>&#128269;</button>-->
<span data-search-clear=""><i class="fas fa-times"></i></span>
2022-09-24 20:06:27 +02:00
<p></p>
2022-09-02 09:05:59 +02:00
</div>
</div>
2022-09-18 21:00:35 +02:00
</header>
2022-09-24 20:06:27 +02:00
2022-09-18 21:00:35 +02:00
<div class="HolyGrail-body">
<nav class="HolyGrail-nav">
2022-09-02 09:05:59 +02:00
<ul>
{%- for item in tree.children recursive %}
{%- set name = item.name.split('/')[-1] -%}
{%- if item.type != "directory" -%}
<li><a href="{{ item.name }}.html">{{ name }}</a></li>
{%- else -%}
{%- if item.children|length -%}
<details id={{ name }} ontoggle="linkClick(this); return false;" ><summary>{{ name[0]|upper }}{{ name[1:] }}</summary>
{%- endif -%}
{%- endif -%}
{%- if item.children and item.children|length -%}
<ul>{{ loop(item.children) }}</ul></details>
{%- endif %}
{%- endfor %}
</ul>
2022-09-18 21:00:35 +02:00
</nav>
<main class="HolyGrail-content">{% block content %}{% endblock %}</main>
{{ toc | safe }}
</div>
<footer>
2022-09-02 09:05:59 +02:00
{% block footer %}
<p></p>
<center>
&copy; Stefan Friese
</center>
{% endblock %}
2022-09-18 21:00:35 +02:00
</footer>
</body>
2022-09-02 09:05:59 +02:00
<script>
2022-09-06 23:45:26 +02:00
function linkClick(obj) {
2022-09-02 09:05:59 +02:00
if (obj.open) {
2022-09-06 23:45:26 +02:00
//console.log('open');
2022-09-02 09:05:59 +02:00
if (sessionStorage.getItem(obj.id) && !(sessionStorage.getItem(obj.id) === "open")) {
sessionStorage.removeItem(obj.id);
}
2022-09-06 23:45:26 +02:00
sessionStorage.setItem(obj.id,"open");
console.log(obj.id);
2022-09-02 09:05:59 +02:00
} else {
2022-09-06 23:45:26 +02:00
//console.log('closed');
sessionStorage.removeItem(obj.id);
}
}
2022-09-02 09:05:59 +02:00
2022-09-06 23:45:26 +02:00
let _keys = Object.keys(sessionStorage);
if (_keys) {
for ( let i = 0; i < _keys.length; i++ ) {
document.getElementById(_keys[i])['open'] = 'open';
}
}
2022-09-02 09:05:59 +02:00
</script>
2022-09-06 23:45:26 +02:00
<script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
2022-09-02 09:05:59 +02:00
<script type="text/x-mathjax-config">
2022-09-06 23:45:26 +02:00
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
extensions: ["MathMenu.js", "MathZoom.js"]
});
</script>
2022-09-02 09:05:59 +02:00
</body>
</html>