publishing Paxover to Codeberg

This commit is contained in:
2023-01-12 20:00:00 +01:00
commit 690707f090
45 changed files with 1796 additions and 0 deletions

44
templates/blog.html.twig Normal file
View File

@@ -0,0 +1,44 @@
{% extends 'partials/base.html.twig' %}
{% if uri.param('tag') %}
{% set page_title = theme_config.blog.tag_title | default('Tag: ') ~ uri.param('tag') %}
{% else %}
{% set page_title = theme_config.blog.title | default('Blog') %}
{% endif %}
{% block content %}
{% set collection = page.collection({
'items': '@self.children',
'pagination': true,
'order': {'by': 'date', 'dir': 'desc'},
'limit': theme_config.blog.pagination_limit})
%}
{% set itemsInCollection = page.collection({'items': collection.params.items})|length %}
{% set currentPage = uri.param('page')|default('1') %}
{% set itemsPerPage = collection.params.limit %}
{% set pagesInCollection = (itemsInCollection / itemsPerPage)|round(0, 'ceil') %}
{% if page_title == 'Blog' %}
{{ page.content | raw }}
{% else %}
<h2>{{ page_title }}</h2>
{% endif %}
<div class="blog">
{% for child in collection %}
{% include 'partials/blog-list-item.html.twig' with {blog: page, page: child} %}
{% endfor %}
</div>
{% if itemsInCollection > itemsPerPage %}
<div class="pagination">
{% if currentPage != '1' %}
<span class="pagination-newer"><a href="{{ page.url(true) ~ '/page' ~ system.param_sep ~ (currentPage - 1) }}">{{ theme_config.blog.pagination_newer }}</a></span>
{% endif %}
{% if (currentPage + 1) <= pagesInCollection %}
<span class="pagination-older"><a href="{{ page.url(true) ~ '/page' ~ system.param_sep ~ (currentPage + 1) }}">{{ theme_config.blog.pagination_older}}</a></span>
{% endif %}
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
{% if page.header.left %}
<div class="left">
{{ page.content | raw }}
</div>
{% else %}
{{ page.content|raw }}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,44 @@
{% extends 'partials/base.html.twig' %}
{% if uri.param('tag') %}
{% set page_title = theme_config.blog.tag_title | default('Tag: ') ~ uri.param('tag') %}
{% else %}
{% set page_title = theme_config.blog.title | default('Blog') %}
{% endif %}
{% block content %}
{% set collection = page.collection({
'items': '@self.children',
'pagination': true,
'order': {'by': 'date', 'dir': 'desc'},
'limit': theme_config.blog.pagination_limit})
%}
{% set itemsInCollection = page.collection({'items': collection.params.items})|length %}
{% set currentPage = uri.param('page')|default('1') %}
{% set itemsPerPage = collection.params.limit %}
{% set pagesInCollection = (itemsInCollection / itemsPerPage)|round(0, 'ceil') %}
{% if page_title == 'Blog' %}
{{ page.content | raw }}
{% else %}
<h2>{{ page_title }}</h2>
{% endif %}
<div class="blog">
{% for child in collection %}
{% include 'partials/blog-list-item.html.twig' with {blog: page, page: child} %}
{% endfor %}
</div>
{% if itemsInCollection > itemsPerPage %}
<div class="pagination">
{% if currentPage != '1' %}
<span class="pagination-newer"><a href="{{ page.url(true) ~ '/page' ~ system.param_sep ~ (currentPage - 1) }}">{{ theme_config.blog.pagination_newer_en }}</a></span>
{% endif %}
{% if (currentPage + 1) <= pagesInCollection %}
<span class="pagination-older"><a href="{{ page.url(true) ~ '/page' ~ system.param_sep ~ (currentPage + 1) }}">{{ theme_config.blog.pagination_older_en}}</a></span>
{% endif %}
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,6 @@
{% extends 'partials/base.html.twig' %}
{% set page_title = 'Error 404' %}
{% block content %}
<h2>Error 404</h2>
<p>This page doesn't exist</p>
{% endblock %}

View File

@@ -0,0 +1,20 @@
{% extends 'partials/base.html.twig' %}
{% set hero_image = page.media.images|first %}
{% block content %}
<div class="profile">
<img class="img-profile" src="{{ hero_image.url|raw }}" />
</div>
<div class="about">
{{ page.content | raw }}
</div>
<div class="social">
{% for button in theme_config.social_buttons %}
<a class="btn {{ button.class }}" target="_blank" rel="me nofollow noopener noreferrer" href="{{ button.link }}" title="{{ button.title_en }}">{{ button.name }}</a>
{% endfor %}
</div>
<div class="contact">
<p>{{ theme_config.contact_en|raw }}</p>
</div>
<p class="annotation"><a href="/">{{ theme_config.lang_title_en }}</a></p>
</div>
{% endblock %}

View File

@@ -0,0 +1,22 @@
{% if theme_config.cusdis.domain %}
<h2 class="left">{{ theme_config.cusdis.title_en|raw }}</h2>
{% if page.header.disableComments %}
<p class="left">{{ theme_config.cusdis.disable_comments_en|raw }}</p>
{% else %}
{% if theme_config.cusdis.lang_en %}
<script>{{ theme_config.cusdis.lang_en|raw }}</script>
{% endif %}
<div id="cusdis_thread"
data-host="https://{{ theme_config.cusdis.domain }}"
data-app-id="{{ theme_config.cusdis.app_id }}"
data-page-id="{{ page.slug }}"
data-page-url="{{ page.url(true) }}"
data-page-title="{{ page.title }}"
data-theme="auto"
></div>
<script async defer src="https://{{ theme_config.cusdis.domain }}/js/cusdis.es.js"></script>
{% if theme_config.cusdis.legal_info_en %}
<p class="annotation">{{ theme_config.cusdis.legal_info_en|raw }}</p>
{% endif %}
{% endif %}
{% endif %}

View File

@@ -0,0 +1,10 @@
{% if theme_config.footer.year == "now"|date("Y") %}
{% set year = "now"|date("Y") %}
{% else %}
{% set year = theme_config.footer.year ~ "-" ~ "now"|date("y") %}
{% endif %}
<span class="footer-copyright">&copy; {{ year }}</span>
<span class="footer-link">
<a href="/en{{ theme_config.footer.url }}">{{ theme_config.footer.title_en }}</a>
</span>
{{ theme_config.analytics|raw }}

View File

@@ -0,0 +1,8 @@
<div class="left">
<h2>{{ theme_config.blog.share_en|raw }}</h2>
<div class="share">
{% for button in theme_config.blog.share_buttons %}
<a class="btn {{ button.class }}" target="_blank" rel="nofollow noopener noreferrer" href="{{ button.link }}?{{ button.url_param }}={{ page.url(true) }}" title="{{ button.title_en }}">{{ button.name }}</a>
{% endfor %}
</div>
</div>

View File

@@ -0,0 +1,6 @@
{% extends 'partials/base.html.twig' %}
{% set page_title = 'Błąd 404' %}
{% block content %}
<h2>Błąd 404</h2>
<p>Ta strona nie istnieje</p>
{% endblock %}

20
templates/index.html.twig Normal file
View File

@@ -0,0 +1,20 @@
{% extends 'partials/base.html.twig' %}
{% set hero_image = page.media.images|first %}
{% block content %}
<div class="profile">
<img class="img-profile" src="{{ hero_image.url|raw }}" />
</div>
<div class="about">
{{ page.content | raw }}
</div>
<div class="social">
{% for button in theme_config.social_buttons %}
<a class="btn {{ button.class }}" target="_blank" rel="me nofollow noopener noreferrer" href="{{ button.link }}" title="{{ button.title }}">{{ button.name }}</a>
{% endfor %}
</div>
<div class="contact">
<p>{{ theme_config.contact|raw }}</p>
</div>
<p class="annotation"><a href="/en">Read this in english</a></p>
</div>
{% endblock %}

View File

@@ -0,0 +1,117 @@
{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
<!DOCTYPE html>
<html lang="{{ (grav.language.getActive ?: grav.language.getDefault)|e }}">
<head>
{% block head %}
<meta charset="utf-8" />
<title>{% if page_title %}{{ page_title|e }} | {% elseif header.title %}{{ header.title|e }} | {% endif %}{{ site.title|e }}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% if site.author.name %}
<meta name="author" content="{{ site.author.name }}, {{ site.author.email }}" />
{% endif %}
{% if theme_config.blog.slug ~ '/' in page.url %}
<meta name="description" content="{{ page.summary | striptags }}">
{% else %}
<meta name="description" content="{{ site.metadata.description }}">
{% endif %}
{% if page.taxonomy.tag %}
<meta name="keywords" content="{% for tag in page.taxonomy.tag %}{{tag}}, {% endfor %}{{ site.metadata.keywords }}" />
{% else %}
<meta name="keywords" content="{{ site.metadata.keywords }}" />
{% endif %}
<meta name="twitter:card" content="summary" />
{% if header.title %}
<meta name="twitter:title" content="{{ header.title }} | {{ site.title }}" />
{% else %}
<meta name="twitter:title" content="{{ site.title }}" />
{% endif %}
{% if theme_config.blog.slug ~ '/' in page.url %}
<meta name="twitter:description" content="{{ page.summary | striptags }}" />
{% else %}
<meta name="twitter:description" content="{{ site.metadata.description }}" />
{% endif %}
{% if hero_image.url %}
<meta name="twitter:image" content="{{ hero_image.url|raw }}" />
{% else %}
<meta name="twitter:image" content="{{ url('theme://images/logo.png') }}" />
{% endif %}
{% if page.header.link %}
<meta name="twitter:url" content="{{ page.header.link }}" />
{% else %}
<meta name="twitter:url" content="{{ page.url(true) }}" />
{% endif %}
{% if header.title %}
<meta property="og:title" content="{{ header.title }}" />
{% else %}
<meta property="og:title" content="{{ site.title }}" />
{% endif %}
{% if theme_config.blog.slug ~ '/' in page.url %}
<meta name="og:description" content="{{ page.summary | striptags }}" />
{% else %}
<meta name="og:description" content="{{ site.metadata.description }}" />
{% endif %}
{% if theme_config.blog.slug ~ '/' in page.url %}
<meta property="og:type" content="article" />
{% else %}
<meta property="og:type" content="website" />
{% endif %}
{% if page.header.link %}
<meta property="og:url" content="{{ page.header.link }}" />
{% else %}
<meta property="og:url" content="{{ page.url(true )}}" />
{% endif %}
{% if hero_image.url %}
<meta property="og:image" content="{{ hero_image.url|raw }}" />
{% else %}
<meta property="og:image" content="{{ url('theme://images/logo.png') }}" />
{% endif %}
<meta name="robots" content="index, follow" />
<link rel="alternate" href="/rss" title="{{ site.title }}" type="application/atom+xml"/>
<link rel="icon" type="image/png" href="{{ url('theme://images/favicon-16x16.png') }}" sizes="16x16">
<link rel="icon" type="image/png" href="{{ url('theme://images/favicon-32x32.png') }}" sizes="32x32">
<link rel="canonical" href="{{ page.url(true, true)|e }}" />
{% endblock head %}
{% block stylesheets %}
{% do assets.addCss('theme://css/style.css') %}
{% do assets.addCss('theme://fonts/opensans/local.css') %}
{% do assets.addCss('theme://fonts/sourcecodepro/local.css') %}
{% endblock %}
{{ assets.css() | raw }}
</head>
<body id="top">
{% block header %}
<div class="navigation">
{% block header_navigation %}
<nav>
{% include 'partials/navigation.html.twig' %}
</nav>
{% endblock %}
</div>
{% endblock %}
{% block body %}
<div class="content">
{% block content %}{% endblock %}
</div>
{% endblock %}
{% block footer %}
<div class="footer">
<footer>
{% include 'partials/footer.html.twig' %}
</footer>
</div>
{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,15 @@
{% set hero_image = page.media.images|first %}
<a class="card-link" href="{{ page.url }}">
<article class="blog-card">
<img alt="{{ hero_image.meta.alt|striptags }}" src="{{ hero_image.cropZoom(350,250).url|raw }}" class="post-image">
<div class="post-details">
<h4 class="post-meta">{{ page.date|date("d.m.Y") }}</h4>
<h2 class="post-title">{{ page.title }}</h2>
<p class="post-description">
{{ page.summary | striptags }}
</p>
<p class="post-tags">{% for tag in page.taxonomy.tag %}<span href="{{ theme_config.blog.slug }}/tag:{{tag}}">{{ tag }}</span>&ensp;{% endfor %}</p>
</div>
</article>
</a>

View File

@@ -0,0 +1,22 @@
{% if theme_config.cusdis.domain %}
<h2 class="left">{{ theme_config.cusdis.title|raw }}</h2>
{% if page.header.disableComments %}
<p class="left">{{ theme_config.cusdis.disable_comments|raw }}</p>
{% else %}
{% if theme_config.cusdis.lang %}
<script>{{ theme_config.cusdis.lang|raw }}</script>
{% endif %}
<div id="cusdis_thread"
data-host="https://{{ theme_config.cusdis.domain }}"
data-app-id="{{ theme_config.cusdis.app_id }}"
data-page-id="{{ page.slug }}"
data-page-url="{{ page.url(true) }}"
data-page-title="{{ page.title }}"
data-theme="auto"
></div>
<script async defer src="https://{{ theme_config.cusdis.domain }}/js/cusdis.es.js"></script>
{% if theme_config.cusdis.legal_info %}
<p class="annotation">{{ theme_config.cusdis.legal_info|raw }}</p>
{% endif %}
{% endif %}
{% endif %}

View File

@@ -0,0 +1,10 @@
{% if theme_config.footer.year == "now"|date("Y") %}
{% set year = "now"|date("Y") %}
{% else %}
{% set year = theme_config.footer.year ~ "-" ~ "now"|date("y") %}
{% endif %}
<span class="footer-copyright">&copy; {{ year }}</span>
<span class="footer-link">
<a href="{{ theme_config.footer.url }}">{{ theme_config.footer.title }}</a>
</span>
{{ theme_config.analytics|raw }}

View File

@@ -0,0 +1,2 @@
<a class="nav-brand" href="/">{{ site.title|e }}</a>
<a class="nav-btn" href="{{ theme_config.blog.slug }}">Blog</a>

View File

@@ -0,0 +1,8 @@
<div class="left">
<h2>{{ theme_config.blog.share|raw }}</h2>
<div class="share">
{% for button in theme_config.blog.share_buttons %}
<a class="btn {{ button.class }}" target="_blank" rel="nofollow noopener noreferrer" href="{{ button.link }}?{{ button.url_param }}={{ page.url(true) }}" title="{{ button.title }}">{{ button.name }}</a>
{% endfor %}
</div>
</div>

17
templates/post.html.twig Normal file
View File

@@ -0,0 +1,17 @@
{% extends 'partials/base.html.twig' %}
{% set hero_image = page.media.images|first %}
{% block content %}
<article class="post">
<h2>{{ page.title }}</h2>
<div class="meta">
<p>{{ page.date|date("d") }}.{{ page.date|date("m") }}.{{ page.date|date("Y") }}</p>
<p>Tagi: {% for tag in page.taxonomy.tag %}<a href="{{ theme_config.blog.slug }}/tag:{{tag}}">{{ tag }}</a>&ensp;{% endfor %}</p>
</div>
{{ page.content | raw }}
</article>
{% if not page.header.disableSharing %}
{% include 'partials/share.html.twig' %}
{% endif %}
{% include 'partials/comments.html.twig' %}
{% endblock %}