chore: internal refactor

This commit is contained in:
zaaarf 2024-01-02 12:18:18 +01:00
parent 40785d8267
commit 14013e7834
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B
17 changed files with 191 additions and 191 deletions

View file

@ -10,15 +10,20 @@
height: 44px;
}
&__mark {
&-link {
text-decoration: none;
float: left;
}
&-mark {
margin-right: 5px;
}
&__text {
&-text {
white-space: nowrap;
}
&__cursor {
&-cursor {
display: inline-block;
width: 10px;
height: 1.5rem;
@ -29,7 +34,7 @@
}
@media (prefers-reduced-motion: reduce) {
&__cursor {
&-cursor {
animation: none;
}
}

View file

@ -12,12 +12,6 @@
}
}
:root.light {
.darkOnly {
display: none;
}
}
::-moz-selection, ::selection {
color: var(--bgColor);
background: var(--fgColor);
@ -161,13 +155,13 @@ footer {
color: var(--fgColor);
background-color: transparent;
&__background:hover, &__background:focus {
&-background:hover, &-background:focus {
color: var(--linkColor);
background-color: transparent;
}
}
.tagsData {
.tags-data {
display: flex;
flex-direction: column;
flex-wrap: wrap;

View file

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "page.html" %}
{% block content %}
<div class="error404">
@ -6,6 +6,6 @@
<h2>not found</h2>
<p>Yeah, sorry, it's just that boring old error. Not even a cool one like <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418">418</a>, or a scary one like <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500">500</a>. Just a plain, old, boring <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404">404</a>: The page you were trying to reach just doesn't seem to be there, so either the link is broken or you made a typo.</p>
<p>I suppose I shouldn't rule out the possibility that you had enough time on your hands that checking out the zaaarf.foo 404 page seemed like a productive use for it. If that's the case, I urge you to get a job or hobby ASAP.</p>
<p>If, however, you <em>do</em> have a legitimate reason for being here, I'd appreciate it if you took the time to notify whoever sent you here that the link is broken.</p>
<p>If, however, you <em>do</em> have a legitimate reason for being here, I'd appreciate it if you took the time to notify whoever sent you here that the link is broken. Cheers!</p>
</div>
{% endblock content %}

View file

@ -1,15 +0,0 @@
<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 }}">&#47;{{ tag }}&#47;</a>
{% endfor %}
{% endif %}
</p>

View file

@ -1,20 +0,0 @@
<!DOCTYPE html>
<html lang="{% if page %}{{ page.lang }}{% else %}{{ config.default_language }}{% endif %}">
<head>
{% include "head.html" %}
</head>
<body>
<div class="wrapper">
<header>
{% include "header.html" %}
</header>
<main>
{% block content %}
{% endblock content %}
</main>
<footer>
{% include "footer.html" %}
</footer>
</div>
</body>
</html>

View file

@ -1,13 +0,0 @@
<hr>
<div class=foot-container>
<div class="foot-left">
<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 the <a target="_blank" rel="noopener noreferrer" href="https://git.fantabos.co/friendenstein">friendenstein</a> theme.<br>
</p>
</div>
{% if config.generate_feed %}
<div class="foot-right">
<a class="icons__background" target="_blank" rel="noopener noreferrer" href="{{ get_url(path="atom.xml", trailing_slash=false) }}" title="Subscribe via RSS for updates."><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#rss', trailing_slash=false) | safe }}"></use></svg></a>
</div>
{% endif %}
</div>

View file

@ -1,99 +1,80 @@
{% import "macros/marginals.html" as marginals %}
<meta charset="UTF-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<meta name="robots" content="index, follow">
{% if page.title %}
{% set title = page.title %}
{% set title = page.title %}
{% elif section.title %}
{% set title = section.title %}
{% set title = section.title %}
{% elif config.title %}
{% set title = config.title %}
{% set title = config.title %}
{% endif %}
{% if page.extra.author %}
{% set author = page.extra.author %}
{% set author = page.extra.author %}
{% elif section.extra.author %}
{% set author = section.extra.author %}
{% set author = section.extra.author %}
{% elif config.extra.author %}
{% set author = config.extra.author %}
{% set author = config.extra.author %}
{% endif %}
{% if page.description %}
{% set description = page.description | truncate(length=150) %}
{% set description = page.description | truncate(length=150) %}
{% elif section.description %}
{% set description = section.description | truncate(length=150) %}
{% set description = section.description | truncate(length=150) %}
{% elif config.description %}
{% set description = config.description | truncate(length=150) %}
{% set description = config.description | truncate(length=150) %}
{% endif %}
{% if page.extra.image %}
{% set image = get_url(path=page.extra.image, trailing_slash=false) %}
{% set image = get_url(path=page.extra.image, trailing_slash=false) %}
{% elif section.extra.image %}
{% set image = get_url(path=section.extra.image, trailing_slash=false) %}
{% set image = get_url(path=section.extra.image, trailing_slash=false) %}
{% elif config.extra.favicon %}
{% set image = get_url(path=config.extra.favicon, trailing_slash=false) %}
{% set image = get_url(path=config.extra.favicon, trailing_slash=false) %}
{% endif %}
{% if page.permalink %}
{% set url = page.permalink %}
{% set url = page.permalink %}
{% elif section.permalink %}
{% set url = section.permalink %}
{% set url = section.permalink %}
{% elif config.base_url %}
{% set url = config.base_url %}
{% set url = config.base_url %}
{% endif %}
{% if title %}
{% if title == config.title %}
<title>{{ title }} :: Home</title>
{% else %}
<title>{{config.title }} :: {{ title }}</title>
{% endif %}
{% if title == config.title %}
<title>{{ title }} :: Home</title>
{% else %}
<title>{{config.title }} :: {{ title }}</title>
{% endif %}
{% endif %}
{% block metatags %}
{% if title %}
<meta name="title" content="{{ title }}">
{% endif %}
{% if author %}
<meta name="author" content="{{ author }}">
<meta name="title" content="{{ title }}">
<meta property="og:site_name" content="{{ config.title }}">
<meta property="og:title" content="{{ title }}">
{% endif %}
{% if author %}<meta name="author" content="{{ author }}">{% endif %}
{% if description %}
<meta name="description" content="{{ description }}">
<meta name="description" content="{{ description }}">
<meta property="og:description" content="{{ description }}">
{% endif %}
<meta property="og:type" content="website">
<meta property="og:url" content="{{ url | safe }}">
{% if title %}
<meta property="og:site_name" content="{{ config.title }}">
{% endif %}
{% if title %}
<meta property="og:title" content="{{ title }}">
{% endif %}
{% if description %}
<meta property="og:description" content="{{ description }}">
{% endif %}
{% if image %}
<meta property="og:image" content="{{ image }}">
{% endif %}
{% if image %}<meta property="og:image" content="{{ image }}">{% endif %}
{% set twitter_card = config.extra.twitter_card | default(value=true) %}
{% if twitter_card != false %}
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="{{ url | safe }}">
{% if title %}
<meta property="twitter:title" content="{{ title }}">
{% endif %}
{% if description %}
<meta property="twitter:description" content="{{ description }}">
{% endif %}
{% if image %}
<meta property="twitter:image" content="{{ image }}">
{% endif %}
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="{{ url | safe }}">
{% if title %}<meta property="twitter:title" content="{{ title }}">{% endif %}
{% if description %}<meta property="twitter:description" content="{{ description }}">{% endif %}
{% if image %}<meta property="twitter:image" content="{{ image }}">{% endif %}
{% endif %}
<link rel="canonical" href="{{ url | safe }}">
{% if image %}
<link rel="shortcut icon" type="image/x-icon" href="{{ get_url(path=config.extra.favicon, trailing_slash=false) }}">
{% endif %}
{% 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 %}
<link rel="alternate" type="application/atom+xml" title="RSS" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">
{% if config.generate_feed %}<link rel="alternate" type="application/atom+xml" title="RSS" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">{% endif %}
{% endblock feed %}
{% endif %}
{% block css %}
<style>
:root,
@ -116,7 +97,7 @@
}
</style>
{% if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
<link id="syntaxHighlighting" rel="stylesheet" type="text/css" href="{{ get_url(path='ayu-dark.css', trailing_slash=false) | safe }}" />
<link id="syntaxHighlighting" rel="stylesheet" type="text/css" href="{{ get_url(path='ayu-dark.css', trailing_slash=false) | safe }}" />
{% endif %}
<link rel="stylesheet" href="{{ get_url(path='style.css', trailing_slash=false) | safe }}"/>
{% endblock css %}

View file

@ -1,28 +0,0 @@
{% set current_lang = config.default_language %}
{% if page %}
{% set current_lang = page.lang %}
{% elif section %}
{% set current_lang = section.lang %}
{% endif %}
{% if config.extra.header_nav %}
<nav class="navbar">
{% include "logo.html" %}
<div class="theme-button">
{% if not config.extra.default_theme %}
<button class="theme-button light" onclick="setTheme('light')" title="Light mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use></svg></button>
<button class="theme-button dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use></svg></button>
{% elif config.extra.default_theme and config.extra.default_theme == "light" %}
<button class="theme-button light" onclick="setTheme('light')" title="Light mode"><svg class="icons icons__background"> <use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use></svg></button>
<button class="theme-button dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use></svg></button>
{% elif config.extra.default_theme and config.extra.default_theme == "dark" %}
<button class="theme-button dark" onclick="setTheme('dark')" title="Dark mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use></svg></button>
<button class="theme-button light" onclick="setTheme('light')" title="Light mode"><svg class="icons icons__background"><use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use></svg></button>
{% endif %}
</div>
<div class="navbar-right">
{% for nav_item in config.extra.header_nav %}
<a href="{{ nav_item.url }}" class="{% if current_url and nav_item.url == current_url %}active{% endif %}">{% set language_key = 'name_' ~ current_lang %}{{ nav_item[language_key] }}</a>
{% endfor %}
</div>
</nav>
{% endif %}

View file

@ -1,5 +1,5 @@
{% import "macros/svg.html" as svg %}
{% extends "base.html" %}
{% extends "page.html" %}
{% block content %}
<div class="home-container"><div class="home">

View file

@ -1,29 +0,0 @@
<a href="{% if config.extra.logo.url %}{{ config.extra.logo.url }}{% else %}{{ config.base_url }}{% endif %}" style="text-decoration: none; float: left;">
<div class="logo">
{% if config.extra.logo.path %}
<img src="{{ config.extra.logo.path }}"
{% if config.extra.logo.alt %}
alt="{{ config.extra.logo.alt }}"
{% endif %}
/>
{% else %}
<span class="logo__text">
{% if config.extra.logo.text %}{{ config.extra.logo.text }}{% else %}home{% endif %}
</span>
<span class="logo__cursor" style="
{% if config.extra.logo.cursor.enabled %}
{% if config.extra.logo.cursor.enabled != true %}
visibility: hidden;
{% endif %}
{% endif %}
{% if config.extra.logo.cursor.color %}
background-color: {{ config.extra.logo.cursor.color }};
{% endif %}
{% if config.extra.logo.cursor.animate %}
animation-duration: {{ config.extra.logo.cursor.animate }};
{% endif %}
">
</span>
{% endif %}
</div>
</a>

View file

@ -0,0 +1,78 @@
{% macro logo() %}
<a href="{{ config.extra.logo.url | default(value=config.base_url) }}" class="logo-link">
<div class="logo">
{% if config.extra.logo.path %}
<img src="{{ config.extra.logo.path }}"
{% if config.extra.logo.alt %}
alt="{{ config.extra.logo.alt }}"
{% endif %}
/>
{% else %}
<span class="logo-text">
{{ config.extra.logo.text | default(value="home") }}
</span>
<span class="logo-cursor" style="
{% if config.extra.logo.cursor.enabled %}
{% if config.extra.logo.cursor.enabled != true %}
visibility: hidden;
{% endif %}
{% endif %}
{% if config.extra.logo.cursor.color %}
background-color: {{ config.extra.logo.cursor.color }};
{% endif %}
{% if config.extra.logo.cursor.animate %}
animation-duration: {{ config.extra.logo.cursor.animate }};
{% endif %}
">
</span>
{% endif %}
</div>
</a>
{% endmacro logo %}
{% macro navbar(current_lang) %}
{% if config.extra.header_nav %}
<nav class="navbar">
{{ self::logo() }}
<div class="theme-button">
<button
class="theme-button light-only"
onclick="setTheme('dark')"
title="Dark mode">
<svg class="icons icons-background">
<use href="{{ get_url(path='icons.svg#darkMode', trailing_slash=false) | safe }}"></use>
</svg>
</button>
<button
class="theme-button dark-only"
onclick="setTheme('light')"
title="Light mode">
<svg class="icons icons-background">
<use href="{{ get_url(path='icons.svg#lightMode', trailing_slash=false) | safe }}"></use>
</svg>
</button>
</div>
<div class="navbar-right">
{% for nav_item in config.extra.header_nav %}
<a href="{{ nav_item.url }}" class="{% if current_url and nav_item.url == current_url %}active{% endif %}">{% set language_key = 'name_' ~ current_lang %}{{ nav_item[language_key] }}</a>
{% endfor %}
</div>
</nav>
{% endif %}
{% endmacro navbar %}
{% macro footer() %}
<hr>
<div class=foot-container>
<div class="foot-left">
<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 the <a target="_blank" rel="noopener noreferrer" href="https://git.fantabos.co/friendenstein">friendenstein</a> theme.<br>
</p>
</div>
{% if config.generate_feed %}
<div class="foot-right">
<a class="icons-background" target="_blank" rel="noopener noreferrer" href="{{ get_url(path="atom.xml", trailing_slash=false) }}" title="Subscribe via RSS for updates."><svg class="icons icons-background"><use href="{{ get_url(path='icons.svg#rss', trailing_slash=false) | safe }}"></use></svg></a>
</div>
{% endif %}
</div>
{% endmacro footer %}

View file

@ -1,7 +1,8 @@
{% macro toc(toc) %}
<div class="toc">
<h2>Table of contents</h2>
<ul>
{% for h1 in page.toc %}
{% for h1 in toc %}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{% if h1.children %}
@ -24,3 +25,14 @@
{% endfor %}
</ul>
</div>
{% endmacro toc %}
{% macro tags(tags) %}
<p class="tags-data">
{% if page.taxonomies.tags %}
{% for tag in tags %}
<a href="/tags/{{ tag | slugify }}">&#47;{{ tag }}&#47;</a>
{% endfor %}
{% endif %}
</p>
{% endmacro tags %}

View file

@ -1,5 +1,43 @@
{% extends "base.html" %}
{% import "macros/marginals.html" as marginals %}
{% import "macros/post.html" as post %}
<!DOCTYPE html>
<html lang="{% if page %}{{ page.lang }}{% else %}{{ config.default_language }}{% endif %}">
<head>
{% include "head.html" %}
</head>
<body>
<div class="wrapper">
<header>
{% set current_lang = config.default_language %}
{% if page %}
{% set current_lang = page.lang %}
{% elif section %}
{% set current_lang = section.lang %}
{% endif %}
{{ marginals::navbar(current_lang=current_lang) }}
</header>
<main>
{% block pre_content %}
{% endblock pre_content %}
<article>
{% block content %}
<h1>{{ page.title }}</h1>
{% block content %}
{% include "base-page.html" %}
{% endblock content %}
{% if page.toc and page.extra.toc %}
{{ post::toc(toc=page.toc) }}
{% endif %}
{{ page.content | safe }}
{% if page.taxonomies.tags %}
{{ post::tags(tags=page.taxonomies.tags) }}
{% endif %}
{% endblock content %}
</article>
</main>
<footer>
{{ marginals::footer() }}
</footer>
</div>
</body>
</html>

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% extends "page.html" %}
{% block content %}
{% block pre_content %}
<div><a href="..">..</a>/<span class="metadata">{{ page.slug }}</span></div>
{% if config.extra.date_format.post %}
{% set datefmt = config.extra.date_format.post %}
@ -11,7 +11,4 @@
{% if config.extra.author and config.extra.display_author == true %}
<address rel="author">By <span class="metadata">{{config.extra.author}}</span></address>
{% endif %}
<article>{% include "base-page.html" %}</article>
{% endblock content %}
{% endblock pre_content %}

View file

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "page.html" %}
{% block content %}
<h1>{{ section.title }}</h1>

View file

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "page.html" %}
{% block content %}
<h1>{{ taxonomy.name }}</h1>

View file

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "page.html" %}
{% block content %}
<h1>{{ term.name }}</h1>