1
0
Fork 0

Init commit

This commit is contained in:
Mo 2022-10-24 16:35:18 +02:00
commit df7a13dc15
8 changed files with 212 additions and 0 deletions

40
config.toml Normal file
View file

@ -0,0 +1,40 @@
# The URL the site will be built for
base_url = "https://yinghong-massage.de"
title = "Ying Yang Massage"
# Whether to automatically compile all Sass files in the sass directory
compile_sass = false
[extra]
logo_path = "images/logo.png"
portrait_path = "images/index/portrait.jpeg"
# Custom colors for navigation bar, footer, h1 tags, etc.
primary_color = "#6db9a5"
secondary_color = "#6e0000"
# Menu
[[extra.menu_items]]
name = "Startseite"
url = "/"
[[extra.menu_items]]
name = "Unser Angebot"
url = "/angebot"
[[extra.menu_items]]
name = "Terminvereinbarung"
url = "/termin"
# Footer
[[extra.footer_items]]
name = "Startseite"
url = "/"
[[extra.footer_items]]
name = "Kontakt"
url = "/kontakt"
[[extra.footer_items]]
name = "Datenschutzerklärung"
url = "/datenschutz"
[[extra.footer_items]]
name = "Impressum"
url = "/impressum"

20
templates/404.html Normal file
View file

@ -0,0 +1,20 @@
{% extends "base.tera.html" %}
{% block content %}
<div class="container text-center">
<h1 class="h1">Seite nicht gefunden</h1>
<img
src="{{ get_url(path='images/404/bot.svg') }}"
class="img-fluid"
width="300"
/>
<div class="d-grid gap-2 pt-3">
<a
class="btn btn-dark"
href="/"
role="button"
>Zurück zur Startseite</a>
</div>
</div>
{% endblock content %}

46
templates/base.tera.html Normal file
View file

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
{% if page.title %}
{{ page.title }}
{% elif section.title %}
{{ section.title }}
{% else %}
{{ config.title }}
{% endif %}
</title>
{% set image = resize_image(path=config.extra.logo_path, width=32, height=32, op="fill") %}
<link
rel="icon"
type="image/x-icon"
href="{{ image.url }}"
/>
<!-- From https://getbootstrap.com/docs/5.2/getting-started/introduction/ -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body class="d-flex flex-column min-vh-100">
{% include "partials/nav.tera.html" %}
<div class="container-xxl">
<br>
{% block content %}{% endblock content %}
</div>
<footer
class="mt-auto"
style="background-image: linear-gradient(white, {{ config.extra.primary_color }} 15%); text-align: center;"
>
{% include "partials/footer.tera.html" %}
</footer>
<!-- From https://getbootstrap.com/docs/5.2/getting-started/introduction/ -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
</body>
</html>

3
templates/index.html Normal file
View file

@ -0,0 +1,3 @@
{% extends "base.tera.html" %}
{% block content %}
{% endblock content %}

View file

@ -0,0 +1,17 @@
<div class="container-xxl">
<br />
<div class="row">
{% for footer_item in config.extra.footer_items %}
<div class="col-sm">
<a href="{{ footer_item.url }}">
<font color="{{ config.extra.secondary_color}}">
{{ footer_item.name }}
</font>
</a>
</div>
{% endfor %}
</div>
<br />
</div>

View file

@ -0,0 +1,74 @@
<nav class="navbar navbar-expand-lg" style="background-color: {{ config.extra.primary_color }};">
<div class="container-xxl">
<a class="navbar-brand" href="/">
<!-- Use heigher resize_height for better resolution -->
{% set resize_height = 85 %}
{% set logo_meta = get_image_metadata(path=config.extra.logo_path) %}
{% set logo_width_to_height_ratio = logo_meta.width / logo_meta.height %}
{% set resize_width = logo_width_to_height_ratio * resize_height | int %}
{% set image = resize_image(path=config.extra.logo_path, width=resize_width, height=resize_height, op="fill") %}
<img
src="{{ image.url }}"
alt="Home"
{% set actual_height = 70 %}
{% set actual_width = logo_width_to_height_ratio * actual_height | int %}
width="{{ actual_width }}"
height="{{ actual_height }}"
/>
</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarNav"
aria-controls="navbarNav"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
{% for menu_item in config.extra.menu_items %}
{% if menu_item.url %}
<!-- Single item, not a category -->
<li class="nav-item">
<a
class="nav-link"
href="{{ menu_item.url }}"
>
<font color="{{ config.extra.secondary_color }}">
{{ menu_item.name }}
</font>
</a>
</li>
{% else %}
<!-- Category with multiple subitems -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<font color="{{ config.extra.secondary_color }}">
{{ menu_item.name }}
</font>
</a>
<ul class="dropdown-menu">
{% for link in menu_item.links %}
<li>
<a
class="dropdown-item"
href="{{ link.url }}"
>
<font color="{{ config.extra.secondary_color }}">
{{ link.name }}
</font>
</a>
</li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
</nav>

View file

@ -0,0 +1,2 @@
{% set link = "<a href='mailto:" ~ email ~ "'>" ~ email ~ "</a>" %}
{{ link | safe }}

View file

@ -0,0 +1,10 @@
{% extends "base.tera.html" %}
{% block content %}
<h1 class="h1">
{{ page.title }}
</h1>
<br>
{{ page.content | safe }}
{% endblock content %}