init
This commit is contained in:
commit
c9def51b7e
38 changed files with 5755 additions and 0 deletions
34
templates/blog.html.twig
Normal file
34
templates/blog.html.twig
Normal file
|
@ -0,0 +1,34 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set collection = page.collection() %}
|
||||
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
|
||||
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
|
||||
{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true) %}
|
||||
{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}
|
||||
|
||||
{% block content %}
|
||||
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
|
||||
{% include 'partials/breadcrumbs.html.twig' %}
|
||||
{% endif %}
|
||||
{% embed 'partials/layout.html.twig' with {blog: page} %}
|
||||
{% block item %}
|
||||
{% for child in collection %}
|
||||
{% if not loop.first %}
|
||||
<hr class="my-5">
|
||||
{% endif %}
|
||||
{% include 'partials/blog-list-item.html.twig' with {blog: page, page: child} %}
|
||||
{% endfor %}
|
||||
|
||||
{% if show_pagination and config.plugins.pagination.enabled and collection.params.pagination %}
|
||||
<div id="listing-footer">
|
||||
{% include 'partials/pagination.html.twig' with {base_url: page.url, pagination: collection.params.pagination} %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'partials/sidebar.html.twig' %}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
5
templates/default.html.twig
Normal file
5
templates/default.html.twig
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content }}
|
||||
{% endblock %}
|
8
templates/error.html.twig
Normal file
8
templates/error.html.twig
Normal file
|
@ -0,0 +1,8 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="lead text-center">
|
||||
<h1>Error!</h1>
|
||||
{{ page.content }}
|
||||
</div>
|
||||
{% endblock %}
|
41
templates/item.html.twig
Normal file
41
templates/item.html.twig
Normal file
|
@ -0,0 +1,41 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
{% set blog = page.find(header_var('blog_url')|defined(theme_var('blog-page'))) %}
|
||||
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog])|defined(true) %}
|
||||
{% set show_sidebar = header_var('show_sidebar', [page, blog])|defined(true) %}
|
||||
{% set show_pagination = header_var('show_pagination', [page, blog])|defined(true) %}
|
||||
{% set hero_image_name = page.header.hero_image %}
|
||||
|
||||
{% block hero %}
|
||||
{% if hero_image_name %}
|
||||
{% set hero_image = page.media[hero_image_name] %}
|
||||
{% set content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
<h2>{{ page.header.subtitle }}</h2>
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
{% include 'partials/blog/taxonomy.html.twig' %}
|
||||
{% endset %}
|
||||
{% include 'partials/hero.html.twig' with {id: 'blog-hero'} %}
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<section id="body-wrapper" class="section blog-listing">
|
||||
<section class="container {{ grid_size }}">
|
||||
|
||||
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
|
||||
{% include 'partials/breadcrumbs.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
{% embed 'partials/layout.html.twig' %}
|
||||
{% block item %}
|
||||
{% include 'partials/blog-item.html.twig' %}
|
||||
{% endblock %}
|
||||
{% block sidebar %}
|
||||
{% include 'partials/sidebar.html.twig' %}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
{% endblock %}
|
71
templates/partials/base.html.twig
Normal file
71
templates/partials/base.html.twig
Normal file
|
@ -0,0 +1,71 @@
|
|||
{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
|
||||
<head>
|
||||
{% block head %}
|
||||
<meta charset="utf-8" />
|
||||
<title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{% include 'partials/metadata.html.twig' %}
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ url('theme://images/logo.png') }}" />
|
||||
<link rel="canonical" href="{{ page.url(true, true) }}" />
|
||||
{% endblock head %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{# do assets.addCss('https://unpkg.com/purecss@1.0.0/build/pure-min.css', 100) #}
|
||||
{% do assets.addCss('https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css', 100) %}
|
||||
{% do assets.addCss('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', 99) %}
|
||||
{% do assets.addCss('theme://css/photoswipe.css', 98) %}
|
||||
{% do assets.addCss('theme://css/default-skin/default-skin.css', 97) %}
|
||||
{% do assets.addCss('theme://css/custom.css', 96) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% do assets.addJs('jquery', 100) %}
|
||||
{% do assets.addJs('https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js', 99) %}
|
||||
{% do assets.addJs('theme://js/photoswipe.min.js', 98) %}
|
||||
{% do assets.addJs('theme://js/photoswipe-ui-default.min.js', 98) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block assets deferred %}
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.js()|raw }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body id="top" class="{{ page.header.body_classes }}">
|
||||
|
||||
<wrapper class="d-flex flex-column">
|
||||
|
||||
{% block header %}
|
||||
{% include 'partials/navbar.html.twig' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<main class="container py-3 flex-fill">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
<footer class="container-fluid bg-dark text-light py-3">
|
||||
<div class="row">
|
||||
<p class="mx-auto"><a href="/impressum">Impressum</a> | <a href="/datenschutzerklaerung">Datenschutzerklärung</a></p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p class="mx-auto">© Heike Tischler</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p class="mx-auto">Diese Webseite nutzt <a href="http://getgrav.org">Grav</a> von <a href="http://www.rockettheme.com">RocketTheme</a>.</p>
|
||||
</div>
|
||||
</footer>
|
||||
{% endblock %}
|
||||
|
||||
{% block bottom %}
|
||||
{{ assets.js('bottom')|raw }}
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
30
templates/partials/blog-item.html.twig
Normal file
30
templates/partials/blog-item.html.twig
Normal file
|
@ -0,0 +1,30 @@
|
|||
<div class="content-item h-entry">
|
||||
|
||||
{% if not hero_image_name %}
|
||||
<div class="content-title text-center">
|
||||
{% include 'partials/blog/title.html.twig' with {title_level: 'h2'} %}
|
||||
{% if page.header.subtitle %}
|
||||
<h3 >{{ page.header.subtitle }}</h3>
|
||||
{% endif %}
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
{% include 'partials/blog/taxonomy.html.twig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="e-content">
|
||||
{{ page.content|raw }}
|
||||
</div>
|
||||
|
||||
{% if page.header.continue_link is same as(true) and config.plugins.comments.enabled %}
|
||||
{% include 'partials/comments.html.twig' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<p class="prev-next text-center">
|
||||
{% if not page.isLast %}
|
||||
<a class="btn" href="{{ page.prevSibling.url }}"><i class="fa fa-angle-left"></i> {{ 'THEME_QUARK.BLOG.ITEM.PREV_POST'|t }}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if not page.isFirst %}
|
||||
<a class="btn" href="{{ page.nextSibling.url }}">{{ 'THEME_QUARK.BLOG.ITEM.NEXT_POST'|t }} <i class="fa fa-angle-right"></i></a>
|
||||
{% endif %}
|
||||
</p>
|
27
templates/partials/blog-list-item.html.twig
Normal file
27
templates/partials/blog-list-item.html.twig
Normal file
|
@ -0,0 +1,27 @@
|
|||
<div class="card">
|
||||
{% set image = page.media.images|first %}
|
||||
{% if image %}
|
||||
<div class="card-image">
|
||||
<a href="{{ page.url }}" class="w-100">{{ image.cropZoom(800,400).html|raw }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card-header container-fluid row mx-0">
|
||||
<div class="col-12 col-sm-9">
|
||||
{% include 'partials/blog/title.html.twig' with {title_level: 'h5'} %}
|
||||
</div>
|
||||
<div class="col-12 col-sm-3 text-gray">
|
||||
{% include 'partials/blog/date.html.twig' %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% if page.summary != page.content %}
|
||||
{{ page.summary|raw }}
|
||||
{% else %}
|
||||
{{ page.content|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-footer p-1">
|
||||
{% include 'partials/blog/taxonomy.html.twig' %}
|
||||
</div>
|
||||
</div>
|
||||
|
5
templates/partials/blog/date.html.twig
Normal file
5
templates/partials/blog/date.html.twig
Normal file
|
@ -0,0 +1,5 @@
|
|||
<span class="blog-date">
|
||||
<time class="dt-published" datetime="{{ page.date|date("c") }}">
|
||||
<i class="fa fa-calendar"></i> {{ page.date|date(system.pages.dateformat.short) }}
|
||||
</time>
|
||||
</span>
|
8
templates/partials/blog/page-summary.html.twig
Normal file
8
templates/partials/blog/page-summary.html.twig
Normal file
|
@ -0,0 +1,8 @@
|
|||
<div class="p-summary e-content">
|
||||
{% if page.summary != page.content %}
|
||||
{{ page.summary|raw }}
|
||||
{% else %}
|
||||
{{ page.content|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
7
templates/partials/blog/taxonomy.html.twig
Normal file
7
templates/partials/blog/taxonomy.html.twig
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% if page.taxonomy.tag %}
|
||||
<span class="tags">
|
||||
{% for tag in page.taxonomy.tag %}
|
||||
<a class="badge badge-secondary" href="{{ blog.url|rtrim('/') }}/tag{{ config.system.param_sep }}{{ tag }}#body-wrapper">{{ tag }}</a>
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
11
templates/partials/blog/title.html.twig
Normal file
11
templates/partials/blog/title.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% set title_level = title_level ?: 'h2' %}
|
||||
{% if page.header.link %}
|
||||
<{{ title_level }} class="p-name">
|
||||
{% if page.header.continue_link is not same as(false) %}
|
||||
<a href="{{ page.url }}"><i class="fa fa-angle-double-right u-url"></i></a>
|
||||
{% endif %}
|
||||
<a href="{{ page.header.link }}" class="u-url">{{ page.title }}</a>
|
||||
</{{ title_level }}>
|
||||
{% else %}
|
||||
<{{ title_level }} class="p-name my-1"><a href="{{ page.url }}" class="u-url">{{ page.title }}</a></{{ title_level }}>
|
||||
{% endif %}
|
13
templates/partials/layout.html.twig
Normal file
13
templates/partials/layout.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% set item_col = show_sidebar ? 'col-12 col-md-9' : 'col-12' %}
|
||||
{% set sidebar_col = show_sidebar ? 'col-12 col-md-3' : 'col-12' %}
|
||||
|
||||
<div class="row">
|
||||
<div id="item" class="{{ item_col }} extra-spacing">
|
||||
{% block item %}{% endblock %}
|
||||
</div>
|
||||
{% if show_sidebar %}
|
||||
<div id="sidebar" class="{{ sidebar_col }}">
|
||||
{% block sidebar %}{% endblock %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
9
templates/partials/logo.html.twig
Normal file
9
templates/partials/logo.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% set logo = theme_var(mobile ? 'custom_logo_mobile' : 'custom_logo') %}
|
||||
<a href="{{ home_url }}" class="navbar-brand mr-10">
|
||||
{% if logo %}
|
||||
{% set logo_file = (logo|first).name %}
|
||||
<img src="{{ url('theme://images/logo/' ~ logo_file) }}" alt="{{ site.name }}" />
|
||||
{% else %}
|
||||
{% include('@images/grav-logo.svg') %}
|
||||
{% endif %}
|
||||
</a>
|
50
templates/partials/navbar.html.twig
Normal file
50
templates/partials/navbar.html.twig
Normal file
|
@ -0,0 +1,50 @@
|
|||
{% macro loop(page) %}
|
||||
{% for p in page.children.visible %}
|
||||
{% set current_page = (p.active or p.activeChild) ? 'selected' : '' %}
|
||||
{% if p.children.visible.count > 0 %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="{{ p.url }}" role="button" aria-haspopup="true" aria-expanded="false">{{ p.menu }}</a>
|
||||
<div class="dropdown-menu">
|
||||
{{ _self.loop(p) }}
|
||||
</div>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ p.url }}">{{ p.menu }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
<nav class="navbar navbar-light navbar-expand-sm bg-light sticky-top">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header">
|
||||
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#collapsing_navbar">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
{% include 'partials/logo.html.twig' %}
|
||||
</div>
|
||||
{% block header_navigation %}
|
||||
<div class="navbar-collapse collapse" id="collapsing_navbar">
|
||||
<ul class="nav navbar-nav">
|
||||
{% if theme_config.dropdown.enabled %}
|
||||
{{ _self.loop(pages) }}
|
||||
{% else %}
|
||||
{% for page in pages.children.visible %}
|
||||
{% set current_page = (page.active or page.activeChild) ? 'selected' : '' %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ page.url }}">{{ page.menu }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% for mitem in site.menu %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ mitem.url }}">{{ mitem.text }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</nav>
|
||||
|
43
templates/partials/sidebar.html.twig
Normal file
43
templates/partials/sidebar.html.twig
Normal file
|
@ -0,0 +1,43 @@
|
|||
{% set feed_url = blog.url == '/' or blog.url == base_url_relative ? (base_url_relative~'/'~blog.slug) : blog.url %}
|
||||
{% set new_base_url = blog.url == '/' ? '' : blog.url %}
|
||||
|
||||
{% if config.plugins.simplesearch.enabled %}
|
||||
<div class="sidebar-content">
|
||||
{% include 'partials/simplesearch_searchbox.html.twig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
|
||||
<div class="sidebar-content">
|
||||
<h4>{{ 'THEME_QUARK.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h4>
|
||||
{% include 'partials/relatedpages.html.twig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if config.plugins.random.enabled %}
|
||||
<div class="sidebar-content">
|
||||
<h4>{{ 'THEME_QUARK.SIDEBAR.RANDOM_ARTICLE.HEADLINE'|t }}</h4>
|
||||
<a class="button" href="{{ base_url }}/random"><i class="fa fa-retweet"></i> {{ 'THEME_QUARK.SIDEBAR.RANDOM_ARTICLE.FEELING_LUCKY'|t }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ page.find('/modules/sidebar').content|raw }}
|
||||
|
||||
{% if config.plugins.taxonomylist.enabled %}
|
||||
<div class="sidebar-content">
|
||||
<h4>Tags in diesem Blog</h4>
|
||||
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if config.plugins.archives.enabled %}
|
||||
<div class="sidebar-content">
|
||||
<h4>Archiv</h4>
|
||||
{% include 'partials/archives.html.twig' with {'base_url':new_base_url} %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if config.plugins.feed.enabled %}
|
||||
<div class="sidebar-content syndicate">
|
||||
<h4>Blog abonnieren</h4>
|
||||
<a class="btn" href="{{ feed_url }}.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
|
||||
<a class="btn" href="{{ feed_url }}.rss"><i class="fa fa-rss-square"></i> RSS</a>
|
||||
{% if config.plugins.feed.enable_json_feed %}<a class="btn" href="{{ feed_url }}.json"><i class="fa fa-rss-square"></i> JSON</a>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
10
templates/partials/taxonomylist.html.twig
Normal file
10
templates/partials/taxonomylist.html.twig
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
|
||||
|
||||
{% if taxlist %}
|
||||
<span class="tags">
|
||||
{% for tax,value in taxlist[taxonomy] %}
|
||||
{% set badge_class = uri.param(taxonomy) == tax ? 'badge-primary' : 'badge-secondary' %}
|
||||
<a class="badge {{ badge_class }}" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }}</a>
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue