mirror of
https://codeberg.org/angestoepselt/homepage.git
synced 2025-05-24 14:46:16 +00:00
Add individual base templates for each site
This commit is contained in:
parent
97bef91387
commit
7ce08acaea
5 changed files with 133 additions and 106 deletions
|
|
@ -1,106 +1,7 @@
|
|||
<!doctype html>
|
||||
<html lang="{{ metadata.language }}" {% if theme.coderdojo %}data-coderdojo="true"{% endif %}>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ title or metadata.title }}</title>
|
||||
|
||||
<link rel="preload" href="{{ '/assets/css/base.css' | url }}" as="style">
|
||||
{# We only bother with preloading the variable font here because chances are
|
||||
that if a browser doesn't support variable fonts it won't support
|
||||
preloading either:
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload#browser_compatibility
|
||||
#}
|
||||
<link rel="preload" href="{{ '/assets/fonts/Comfortaa-VariableFont_wght.ttf' | url }}" as="font" crossorigin="anonymous">
|
||||
{% for name in (extraStylesheets or []) %}
|
||||
<link rel="preload" href="{{ '/assets/css/' + name + '.css' | url }}" as="style">
|
||||
{% endfor %}
|
||||
{% block headStart %}{% endblock %}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
|
||||
<meta name="description" content="{{ description or metadata.description }}">
|
||||
<link rel="alternate" href="{{ metadata.feed.path | url }}" type="application/atom+xml" title="{{ metadata.title }}">
|
||||
<link rel="alternate" href="{{ metadata.jsonfeed.path | url }}" type="application/json" title="{{ metadata.title }}">
|
||||
|
||||
<link rel="stylesheet" href="{{ '/assets/css/base.css' | url }}">
|
||||
{% for name in (extraStylesheets or []) %}
|
||||
<link rel="stylesheet" href="{{ '/assets/css/' + name + '.css' | url }}">
|
||||
{% endfor %}
|
||||
|
||||
{% block headEnd %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-header">
|
||||
<a class="site-logo" href="{{ '/' | url }}">{{ metadata.title }}</a>
|
||||
|
||||
<details class="site-mobile-navigation">
|
||||
<summary>Menü</summary>
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
{% for entry in collections.topNavigation | eleventyNavigation %}
|
||||
<li{% if entry.url == page.url %} class="active"{% endif %}>
|
||||
<a href="{{ entry.url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</details>
|
||||
|
||||
<nav class="site-navigation horizontal">
|
||||
<ul>
|
||||
{% for entry in collections.topNavigation | eleventyNavigation %}
|
||||
<li{% if entry.url == page.url %} class="active"{% endif %}>
|
||||
<a href="{{ entry.url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main id="content" {% if contentClass %} class="{{ contentClass }}"{% endif %}>
|
||||
{% block content %}
|
||||
{{ content | safe }}
|
||||
{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="page-section footer">
|
||||
<div class="page-content site-footer">
|
||||
<div>
|
||||
<p>
|
||||
{{ metadata.author.name }}
|
||||
{% for line in (metadata.author.address or []) %}
|
||||
<br />
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p>
|
||||
{{ metadata.author.email }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
{% for entry in collections.bottomNavigation | eleventyNavigation %}
|
||||
<li{% if entry.url == page.url %} class="active"{% endif %}>
|
||||
<a href="{{ entry.url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="/assets/main.js" lang="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
{% if site and site.id == "angestoepselt" %}
|
||||
{% extends "layouts/base/angestoepselt.njk" %}
|
||||
{% elseif site and site.id == "coderdojo" %}
|
||||
{% extends "layouts/base/coderdojo.njk" %}
|
||||
{% else %}
|
||||
{% extends "layouts/base/main.njk" %}
|
||||
{% endif %}
|
||||
|
|
|
|||
12
includes/layouts/base/angestoepselt.njk
Normal file
12
includes/layouts/base/angestoepselt.njk
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{% extends "layouts/base/main.njk" %}
|
||||
|
||||
{% block sitelogo %}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 90.55 64.6001" class="angestoepselt-logo">
|
||||
<path d="M79.04 28.63h9.51"/>
|
||||
<path d="M79.04 21.31h9.51"/>
|
||||
<path d="M79.04 35.94h9.51"/>
|
||||
<path d="M79.04 43.26h9.51"/>
|
||||
<path class="plug" d="M2 40.19h6.32a1 1 0 0 1 .94 1v11.45a1.07 1.07 0 0 0 .28.73l8.07 8.93a.93.93 0 0 0 .67.3h31.19a2.38 2.38 0 0 0 1.14-.28l4.14-3.61a.86.86 0 0 1 1.1.25l1.58 3.3a.91.91 0 0 0 .71.34h11.17a.92.92 0 0 0 .82-.52l3.89-7.46a2.3 2.3 0 0 0 .28-1.12l.11-44.47a1.07 1.07 0 0 0-.2-.63l-4.18-6a.92.92 0 0 0-.75-.4h-51a.93.93 0 0 0-.67.3l-8.07 8.93a1.07 1.07 0 0 0-.28.73V23.1a1 1 0 0 1-.94 1H2m53.22 16.41a3.43 3.43 0 0 1-.86 2.27l-1.35 1.51a3.41 3.41 0 0 1-2.54 1.14h-19a3.45 3.45 0 0 1-2.54-1.1l-1.35-1.49a3.39 3.39 0 0 1-.87-2.27V23.42a3.39 3.39 0 0 1 .87-2.27l1.35-1.51a3.45 3.45 0 0 1 2.55-1.14h19a3.41 3.41 0 0 1 2.54 1.14l1.35 1.51a3.43 3.43 0 0 1 .86 2.27z" />
|
||||
</svg>
|
||||
<span>Angestöpselt</span>
|
||||
{% endblock %}
|
||||
3
includes/layouts/base/coderdojo.njk
Normal file
3
includes/layouts/base/coderdojo.njk
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{% extends "layouts/base/main.njk" %}
|
||||
|
||||
{% block htmltag %}data-coderdojo="true"{% block %}
|
||||
108
includes/layouts/base/main.njk
Normal file
108
includes/layouts/base/main.njk
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
<!doctype html>
|
||||
<html lang="{{ metadata.language }}" {% block htmltag %}{% endblock %}>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ title or metadata.title }}</title>
|
||||
|
||||
<link rel="preload" href="{{ '/assets/css/base.css' | url }}" as="style">
|
||||
{# We only bother with preloading the variable font here because chances are
|
||||
that if a browser doesn't support variable fonts it won't support
|
||||
preloading either:
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload#browser_compatibility
|
||||
#}
|
||||
<link rel="preload" href="{{ '/assets/fonts/Comfortaa-VariableFont_wght.ttf' | url }}" as="font" crossorigin="anonymous">
|
||||
{% for name in (extraStylesheets or []) %}
|
||||
<link rel="preload" href="{{ '/assets/css/' + name + '.css' | url }}" as="style">
|
||||
{% endfor %}
|
||||
{% block headStart %}{% endblock %}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
|
||||
<meta name="description" content="{{ description or metadata.description }}">
|
||||
<link rel="alternate" href="{{ metadata.feed.path | url }}" type="application/atom+xml" title="{{ metadata.title }}">
|
||||
<link rel="alternate" href="{{ metadata.jsonfeed.path | url }}" type="application/json" title="{{ metadata.title }}">
|
||||
|
||||
<link rel="stylesheet" href="{{ '/assets/css/base.css' | url }}">
|
||||
{% for name in (extraStylesheets or []) %}
|
||||
<link rel="stylesheet" href="{{ '/assets/css/' + name + '.css' | url }}">
|
||||
{% endfor %}
|
||||
|
||||
{% block headEnd %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-header">
|
||||
<a class="site-logo" href="{{ '/' | url }}">
|
||||
{% block sitelogo %}{{ metadata.title }}{% endblock %}
|
||||
</a>
|
||||
|
||||
<details class="site-mobile-navigation">
|
||||
<summary>Menü</summary>
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
{% for entry in collections.topNavigation | eleventyNavigation %}
|
||||
<li{% if entry.url == page.url %} class="active"{% endif %}>
|
||||
<a href="{{ entry.url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</details>
|
||||
|
||||
<nav class="site-navigation horizontal">
|
||||
<ul>
|
||||
{% for entry in collections.topNavigation | eleventyNavigation %}
|
||||
<li{% if entry.url == page.url %} class="active"{% endif %}>
|
||||
<a href="{{ entry.url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main id="content" {% if contentClass %} class="{{ contentClass }}"{% endif %}>
|
||||
{% block content %}
|
||||
{{ content | safe }}
|
||||
{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="page-section footer">
|
||||
<div class="page-content site-footer">
|
||||
<div>
|
||||
<p>
|
||||
{{ metadata.author.name }}
|
||||
{% for line in (metadata.author.address or []) %}
|
||||
<br />
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p>
|
||||
{{ metadata.author.email }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<nav class="site-navigation">
|
||||
<ul>
|
||||
{% for entry in collections.bottomNavigation | eleventyNavigation %}
|
||||
<li{% if entry.url == page.url %} class="active"{% endif %}>
|
||||
<a href="{{ entry.url }}">
|
||||
{{ entry.title }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="/assets/main.js" lang="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
3
sites/angestoepselt/_data/site.json
Normal file
3
sites/angestoepselt/_data/site.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"id": "angestoepselt"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue