mirror of
https://github.com/zaaarf/friendenstein.git
synced 2024-11-22 15:34:50 +01:00
feat: randomized subtitle
This commit is contained in:
parent
1917465ec9
commit
a77515e9c7
8 changed files with 60 additions and 85 deletions
15
templates/base-page.html
Normal file
15
templates/base-page.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<h1>{{ page.title }}</h1>
|
||||
|
||||
{% if page.toc and page.extra.toc %}
|
||||
{% include "toc.html" %}
|
||||
{% endif %}
|
||||
|
||||
{{ page.content | safe }}
|
||||
|
||||
<p class="tagsData">
|
||||
{% if page.taxonomies.tags %}
|
||||
{% for tag in page.taxonomies.tags %}
|
||||
<a href="/tags/{{ tag | slugify }}">/{{ tag }}/</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</p>
|
|
@ -6,42 +6,7 @@
|
|||
{% if config.extra.author and config.extra.display_author == true %}
|
||||
<address rel="author">By <span class="metaData">{{config.extra.author}}</span></address>
|
||||
{% endif %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
|
||||
{% if page.toc and page.extra.toc %}
|
||||
<h2>Table of contents</h2>
|
||||
<ul>
|
||||
{% for h1 in page.toc %}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{% if h1.children %}
|
||||
<ul>
|
||||
{% for h2 in h1.children %}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
<ul>
|
||||
{% for h3 in h2.children %}
|
||||
<li>
|
||||
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% include "base-page.html" %}
|
||||
|
||||
{{ page.content | safe }}
|
||||
|
||||
<p class="tagsData">
|
||||
{% if page.taxonomies.tags %}
|
||||
{% for tag in page.taxonomies.tags %}
|
||||
<a href="/tags/{{ tag | slugify }}">/{{ tag }}/</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endblock content %}
|
|
@ -2,7 +2,7 @@
|
|||
<div class=footContainer>
|
||||
<div class="footLeft">
|
||||
<p>Licensed under the <a target="_blank" rel="noopener noreferrer" href="https://en.wikipedia.org/wiki/MIT_License">MIT License</a>.<br>
|
||||
Built with <a target="_blank" rel="noopener noreferrer" href="https://www.getzola.org">Zola</a> using <a target="_blank" rel="noopener noreferrer" href="https://github.com/Speyll/anemone">anemone</a> theme & <a target="_blank" rel="noopener noreferrer" href="https://github.com/Speyll/veqev">veqev</a> colors.<br>
|
||||
Built with <a target="_blank" rel="noopener noreferrer" href="https://www.getzola.org">Zola</a> combining the <a target="_blank" rel="noopener noreferrer" href="https://github.com/Speyll/anemone">anemone</a> and <a href="https://github.com/rhazdon/hugo-theme-hello-friend-ng/">hello-friend-ng</a> themes.<br>
|
||||
</p>
|
||||
</div>
|
||||
{% if config.generate_feed %}
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
{% if image %}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{{ get_url(path=config.extra.favicon, trailing_slash=false) }}">
|
||||
{% endif %}
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
{% endblock metatags %}
|
||||
{% if config.generate_feed %}
|
||||
{% block feed %}
|
||||
|
|
|
@ -8,10 +8,23 @@
|
|||
<h1>{{ config.title }}</h1>
|
||||
{% endif %}
|
||||
{% if config.extra.home_subtitle %}
|
||||
<p>{{ config.extra.home_subtitle }}</p>
|
||||
<p>{{ config.extra.home_subtitle }}<span id="subtitleRand"></span></p>
|
||||
{% elif config.description %}
|
||||
<p>{{ config.description }}</p>
|
||||
<p>{{ config.description }}<span id="subtitleRand"></span></p>
|
||||
{% endif %}
|
||||
{% include "svg.html" %}
|
||||
</div>
|
||||
{% if config.extra.home_subtitle_suffixes %}
|
||||
|
||||
<script>
|
||||
const suffixes = [
|
||||
{% for s in config.extra.home_subtitle_suffixes %}
|
||||
"{{ s }}",
|
||||
{% endfor %}
|
||||
]
|
||||
var current = suffixes[Math.floor(Math.random() * suffixes.length)];
|
||||
var span = document.getElementById("subtitleRand");
|
||||
span.textContent = current;
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
|
|
|
@ -1,42 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
|
||||
{% if page.toc and page.extra.toc %}
|
||||
<h2>Table of contents</h2>
|
||||
<ul>
|
||||
{% for h1 in page.toc %}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{% if h1.children %}
|
||||
<ul>
|
||||
{% for h2 in h1.children %}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
<ul>
|
||||
{% for h3 in h2.children %}
|
||||
<li>
|
||||
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{{ page.content | safe }}
|
||||
|
||||
<p class="tagsData">
|
||||
{% if page.taxonomies.tags %}
|
||||
{% for tag in page.taxonomies.tags %}
|
||||
<a href="/tags/{{ tag | slugify }}">/{{ tag }}/</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% include "base-page.html" %}
|
||||
{% endblock content %}
|
|
@ -1,8 +0,0 @@
|
|||
{% if src %}
|
||||
{# If the image's URL is internal to the site... #}
|
||||
{% if src is not starting_with("http") %}
|
||||
{# ... then prepend the site's base URL to the image's URL. #}
|
||||
{% set src = config.base_url ~ src %}
|
||||
{% endif %}
|
||||
<center><img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %} class="{% if position %}{{ position }}{% else -%} center {%- endif %}" {%- if style %} style="border-radius: 8px; {{ style | safe }}" {%- endif %} /></center>
|
||||
{% endif %}
|
26
templates/toc.html
Normal file
26
templates/toc.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
<div class="toc">
|
||||
<h2>Table of contents</h2>
|
||||
<ul>
|
||||
{% for h1 in page.toc %}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{% if h1.children %}
|
||||
<ul>
|
||||
{% for h2 in h1.children %}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
<ul>
|
||||
{% for h3 in h2.children %}
|
||||
<li>
|
||||
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
Loading…
Reference in a new issue