remarkbox-theme-chaostheory/remarkbox_chaostheory/templates/chaostheory-base.j2

92 lines
2.7 KiB
Django/Jinja

{%- import 'snippets/snippets.j2' as snippets with context -%}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{% block title %}foxhop.net{% endblock %}</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/css/common.css">
<link rel="stylesheet" href="/static/theme/chaostheory/css/960.css">
<link rel="stylesheet" href="/static/theme/chaostheory/css/pygments-native.css">
<link rel="stylesheet" href="/static/theme/chaostheory/css/theme.css">
{% include 'snippets/javascript-includes.j2' %}
</head>
<body>
<noscript>
<style>.js-only { display: none; }</style>
</noscript>
{% include 'snippets/flash-alerts.j2' %}
<div id="header">
<a href="/">foxhop.net</a>
</div>
<div class="container_16">
<div id="wikibar" class="grid_16">
<div id="wikibar-left" class="grid_10">
<a href="/" class="on">home</a>
{%- if request.user %}
{{ snippets.user_link(request.user) }}
<a href="/log-out">log out</a>
{%- else %}
<a href="/join-or-log-in">join or log in</a>
{%- endif %}
</div>
<div id="wikibar-right" class="grid_6">
<form action="/search" id="search" onsubmit="submit.disabled = true; return true;">
<input type="hidden" name="namespace" value="{{ request.namespace.name }}">
<input type="input" name="keywords" id="keywords" placeholder="search" required/>
</form>
</div>
</div>
<div class="clear"></div>
<div id="content" class="grid_16">
{% block content %}
{% endblock %}
</div>
</div>
<div id="footer">
{% include 'snippets/powered-by.j2' %}
</div>
<script>
// Build TOC from empty div.contents pandoc placeholder + heading id attrs
document.addEventListener('DOMContentLoaded', function() {
var toc = document.querySelector('#content div.contents');
if (!toc) return;
var content = document.getElementById('content');
var headings = content.querySelectorAll('h2, h3, h4');
if (!headings.length) { toc.style.display = 'none'; return; }
var title = document.createElement('p');
title.style.cssText = 'font-weight:bold; margin:0 0 6px 0; color:#6DCFF6; font-size:0.9em;';
title.textContent = 'Contents';
var ul = document.createElement('ul');
ul.style.margin = '0';
headings.forEach(function(h) {
if (!h.id) return;
var depth = parseInt(h.tagName[1]) - 2;
var li = document.createElement('li');
li.style.paddingLeft = (depth * 12) + 'px';
var a = document.createElement('a');
a.href = '#' + h.id;
a.textContent = h.textContent;
li.appendChild(a);
ul.appendChild(li);
});
toc.appendChild(title);
toc.appendChild(ul);
});
</script>
</body>
</html>