Skip to content

Commit

Permalink
Update to zola 0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
lordiii committed Jun 26, 2024
1 parent 4df62b0 commit f5c5c61
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 65 deletions.
10 changes: 4 additions & 6 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ author = "Markus Framer"
compile_sass = true
minify_html = true
build_search_index = false
generate_feed = true
feed_filename = "rss.xml"
generate_feeds = true
feed_filenames = ["rss.xml", "atom.xml"]

taxonomies = [
{ name = "Serie", feed = true, paginate_by = 10 },
Expand Down Expand Up @@ -79,11 +79,9 @@ title = "Kreativität trifft Technik e.V."
description = "Website of Kreativität trifft Technik e.V."

# Compilation settings
compile_sass = true
minify_html = true
build_search_index = false
generate_feed = true
feed_filename = "rss.xml"
generate_feeds = true
feed_filenames = ["rss.xml", "atom.xml"]

taxonomies = [
{ name = "Series", feed = true, paginate_by = 10 },
Expand Down
22 changes: 0 additions & 22 deletions static/js/site.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
const ifsImageCount = 5;
var currentIfsImage = 0;
function isDarkModeEnabled() {
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
}

function nextIfsImage(direction)
{
currentIfsImage += direction;
currentIfsImage = Math.abs(currentIfsImage % ifsImageCount);

for(let i = 0; i < ifsImageCount; i++)
{
let element = document.getElementById("ifs-image-" + i);
if(i === currentIfsImage)
{
element.classList.remove("d-none");
} else {
if(!element.classList.contains("d-none"))
{
element.classList.add("d-none")
}
}
}
}

if (isDarkModeEnabled()) {
document.getElementsByTagName("html")[0].dataset["bsTheme"] = "dark";
document.getElementById("img-icon-lang").src = "/media/img/lang/icon.dark.svg";
Expand Down
8 changes: 7 additions & 1 deletion static/js/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@ const StateOpen = {
color: "btn-success"
};

const StateUnknown = {
name: "unknown",
color: "btn-white"
};

const States = {
text_id_prefix: "status-text-",
button_id_prefix: "status-",
all_states: [
StateClosed,
StateClosing,
StateOpen
StateOpen,
StateUnknown
],
state_map: {
"none": StateClosed,
Expand Down
6 changes: 2 additions & 4 deletions templates/404.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "base.html" %}

{% block content %}
<h1>404 - {{ trans(key="not_found", lang="de") }}</h1>
<p class="fs-4">{{ trans(key="not_found_content", lang="de") }}</p>
<h1 class="mt-5">404 - {{ trans(key="not_found", lang="en") }}</h1>
<p class="fs-4">{{ trans(key="not_found_content", lang="en") }}</p>
<h1><span class="w-100 text-center">404 - {{ trans(key="not_found", lang=lang) }}</span></h1>
<p class="text-center fs-4">{{ trans(key="not_found_content", lang=lang) }}</p>
{% endblock content %}
20 changes: 8 additions & 12 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{% if lang == config.default_language %}
{% set lang_stub = "" %}
{% else %}
{% set lang_stub = "." ~ lang %}
{% endif %}

<!DOCTYPE html>
<html lang="{{ lang }}" prefix="og: https://ogp.me/ns#" data-bs-theme="light">
<head>
Expand All @@ -15,7 +9,7 @@
<meta property="og:locale:alternate" content='{{ trans(key="locale_name", lang="de") }}'/>
<meta property="og:locale:alternate" content='{{ trans(key="locale_name", lang="en") }}'/>
{% if current_path %}
<meta property="og:url" content="https://mainframe.io{{ current_path }}"/>
<meta property="og:url" content="{{ get_url(path=current_path) }}"/>
{% endif %}

{% if page.authors %}
Expand Down Expand Up @@ -49,22 +43,24 @@

{% include "structured-data.html" %}


<title>{{ title }}</title>
<meta name="description" content='{{ description }}'>
<meta property="og:description" content='{{ description }}'/>
<meta property="og:title" content='{{ title }}'/>

<link integrity='sha384-{{ get_hash(path="css/bootstrap.min.css", sha_type=384, base64=true) | safe }}'
rel="stylesheet"
href="/css/bootstrap.min.css">
href="{{ get_url(path="/css/bootstrap.min.css") }}">

<link integrity='sha384-{{ get_hash(path="css/site.css", sha_type=384, base64=true) | safe }}'
rel="stylesheet"
href="/css/site.css">
href="{{ get_url(path="/css/site.css") }}">

<link rel="alternate" type="application/rss+xml" title="RSS"
href='{{ get_url(path="/rss.xml", trailing_slash=false) }}'>

<link rel="alternate" type="application/rss+xml" title="RSS"
href='{{ get_url(path="rss.xml", trailing_slash=false) }}'>
href='{{ get_url(path="/atom.xml", trailing_slash=false) }}'>
</head>

<body class="vh-100 m-0 p-0">
Expand Down Expand Up @@ -102,7 +98,7 @@
</footer>
</div>

<script src="/js/site.js"
<script src="{{ get_url(path="/js/site.js") }}"
integrity='sha384-{{ get_hash(path="js/site.js", sha_type=384, base64=true) | safe }}'>
</script>

Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h4 class="mb-0">

<div class="row">
<div class="col">
{% set blog_section = get_section(path="blog/_index" ~ lang_stub ~ ".md") %}
{% set blog_section = get_section(path="blog/_index.md", lang=lang) %}
{{ self::blog_list(pages=blog_section.pages | slice(end=5)) }}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

{% if blog_page.extra.thumbnail %}
{% set thumbnail_path = blog_page.extra.thumbnail %}
{% set thumbnail_url = config.extra.resource_base ~ thumbnail_path %}
{% set thumbnail_url = get_url(path=thumbnail_path) %}
{% else %}
{% set thumbnail_path = "/media/img/logo-ktt.png" %}
{% set thumbnail_url = thumbnail_path %}
Expand Down
6 changes: 1 addition & 5 deletions templates/navbar-pagelist.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{% if lang == config.default_language %}
{% set index_section = get_section(path=section_name ~ "/_index.md") %}
{% else %}
{% set index_section = get_section(path=section_name ~ "/_index." ~ lang ~ ".md") %}
{% endif %}
{% set index_section = get_section(path=section_name ~ "/_index.md", lang=lang) %}

<li class="nav-item dropdown">
<div class="nav-link dropdown-toggle" role="button" aria-expanded="false">
Expand Down
16 changes: 8 additions & 8 deletions templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<div class="col">
<nav class="navbar navbar-expand-md bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href='{{ get_url(path="", lang=lang) }}'
<a class="navbar-brand" href='{{ get_url(path="/", lang=lang) }}'
style="padding-top: 10px; padding-bottom: 10px;">
<img style="height: 28px;"
loading="lazy"
decoding="async"
id="img-logo-mainframe"
src="/media/img/logo-mainframe.svg"
src="{{ get_url(path="/media/img/logo-mainframe.svg") }}"
alt="Mainframe Logo">
<img style="height: 50px;"
id="img-logo-ktt"
src="/media/img/logo-ktt.png"
src="{{ get_url(path="/media/img/logo-ktt.png") }}"
loading="lazy"
decoding="async"
alt="Kreativität trifft Technik e.V. Logo">
Expand All @@ -37,23 +37,23 @@
<li class="nav-item">
<a class="nav-link" role="button" aria-expanded="false"
href='{{ get_url(path="@/blog/_index.md", lang=lang) }}'>
{% set blog_section_metadata = get_section(path="blog/_index" ~ lang_stub ~ ".md", metadata_only=true) %}
{% set blog_section_metadata = get_section(path="blog/_index.md", lang=lang, metadata_only=true) %}
{{ blog_section_metadata.title }}
</a>
</li>

<li class="nav-item">
<a class="nav-link" role="button" aria-expanded="false"
href='{{ get_url(path="@/calendar.md", lang=lang) }}'>
{% set contact_page_metadata = get_page(path="calendar" ~ lang_stub ~ ".md", metadata_only=true) %}
{% set contact_page_metadata = get_page(path="calendar.md", lang=lang, metadata_only=true) %}
{{ contact_page_metadata.title }}
</a>
</li>

<li class="nav-item">
<a class="nav-link" role="button" aria-expanded="false"
href='{{ get_url(path="@/contact.md", lang=lang) }}'>
{% set contact_page_metadata = get_page(path="contact" ~ lang_stub ~ ".md", metadata_only=true) %}
{% set contact_page_metadata = get_page(path="contact.md", lang=lang, metadata_only=true) %}
{{ contact_page_metadata.title }}
</a>
</li>
Expand Down Expand Up @@ -93,13 +93,13 @@
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="/{{ raw_path }}">
<img src="/media/img/lang/de.png" class="me-1">
<img src="{{ get_url(path="/media/img/lang/de.png") }}" class="me-1">
Deutsch
</a>
</li>
<li>
<a class="dropdown-item" href="/en/{{ raw_path }}">
<img src="/media/img/lang/en.png" class="me-1">
<img src="{{ get_url(path="/media/img/lang/en.png") }}" class="me-1">
Englisch
</a>
</li>
Expand Down
7 changes: 5 additions & 2 deletions templates/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ <h5 class="border-secondary border-bottom">
<div class="px-2" style="font-size: 0.9em">
{% for room in config.extra.rooms %}
<a role="button" id="status-{{ room.name }}"
class="px-1 d-flex flex-column text-decoration-none btn btn-danger rounded-0 text-dark"
class="px-1 d-flex flex-column text-decoration-none btn btn-white rounded-0 text-dark"
style="margin-bottom: 1px; padding: 1px;"
href="//status.kreativitaet-trifft-technik.de">
<div class="text-start fw-bold lh-sm">
{{ room.title[lang] }}:
</div>
<div class="text-end lh-sm" id="status-text-closed-{{ room.name }}">
<div class="text-end lh-sm" id="status-text-unknown-{{ room.name }}">
???
</div>
<div class="text-end lh-sm d-none" id="status-text-closed-{{ room.name }}">
{{ trans(key="closed", lang=lang) }}
</div>
<div class="text-end lh-sm d-none" id="status-text-closing-{{ room.name }}">
Expand Down
4 changes: 2 additions & 2 deletions templates/taxonomy_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
{% import "macros.html" as macros %}

{% block content %}
{% set blog_section = get_section(path="blog/_index" ~ lang_stub ~ ".md") %}
{% set blog_section = get_section(path="blog/_index.md", lang=lang) %}

<h4>
{{ blog_section.title }} - {{ taxonomy.name }}
</h4>
{% for term in terms %}
<div class="my-2">
<a href="{{ get_url(path=term.path) }}">
<a href="{{ get_url(path=term.path, lang=lang) }}">
{{ term.name }}
</a>
</div>
Expand Down
6 changes: 5 additions & 1 deletion templates/taxonomy_single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
{% import "macros.html" as macros %}

{% block content %}
{% set blog_section = get_section(path="blog/_index" ~ lang_stub ~ ".md") %}
{% set blog_section = get_section(path="blog/_index.md", lang=lang) %}

<h4>
{{ blog_section.title }} - {{ taxonomy.name }} - {{ term.name }}

<span>
<a href="{{ get_url(path=current_path ~ "atom.xml", lang=lang) }}">ATOM</a>
</span>
</h4>
{{ self::blog_list(pages=paginator.pages) }}
{% endblock content %}

0 comments on commit f5c5c61

Please sign in to comment.