This commit is contained in:
Loïc Guibert
2022-09-30 20:06:40 +01:00
commit 0637652909
47 changed files with 10294 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
{% extends 'partials/base.html.twig' %}
{% set collection = page.collection() %}
{% block content %}
<div class="page-content">
<div class="wrapper">
<div class="teaserimage">
<div class="teaserimage-image" {% if page.header.cover %}style="background-image: url({{ page.media[page.header.cover].url }})"{% endif %}>
{{ 'HEADER.TEASER_IMAGE'|t }}
</div>
</div>
</div>
</div>
<header class="blog-header">
{% if site.logo %}
<a class="blog-logo" href="{{ base_url_relative}}" style="background-image: url({{ uri.rootUrl() }}{{ site.logo }})">{{ site.title }}</a>
{% endif %}
<h1 class="blog-title">{{ site.title }}</h1>
<h2 class="blog-description">{{ site.description }}</h2>
<div class="custom-links">
{% for social in site.social %}
{% if social.url %}
<a class="icon-social" href="{{ social.url }}" target="_blank">
<i class="{{ social.icon }}"></i>
</a>
&nbsp;&nbsp;·&nbsp;&nbsp;
{% endif %}
{% endfor %}
<a href="{{ base_url_relative }}/about">{{ 'LINKS.ABOUT'|t }}</a>
&nbsp;&nbsp;·&nbsp;&nbsp;
<a href="{{ base_url_relative }}/contact-temp">Contact</a>
</div>
</header>
<main class="content" role="main">
{% set featured = taxonomy.findTaxonomy({'tag':'featured'}) %}
{% if featured and featured|length > 0 and uri.currentPage == 1 %}
<h5 class="index-headline featured"><span>{{ 'TAGS.FEATURED'|t }}</span></h5>
<div class="container featured">
{% for post in featured %}
{% include 'partials/article.html.twig' %}
{% endfor %}
</div>
<h5 class="index-headline normal"><span>{{ 'TAGS.REGULAR'|t }}</span></h5>
{% endif %}
<div class="cf frame">
{% for post in collection %}
{% include 'partials/article.html.twig' %}
{% endfor %}
</div>
{% if config.plugins.pagination.enabled and collection.params.pagination %}
{% include 'partials/pagination.html.twig' with {'base_url': page.url, 'pagination':collection.params.pagination} %}
{% endif %}
</main>
{% endblock %}

View File

@@ -0,0 +1,2 @@
{% embed 'form.html.twig' with {'is_page': true} %}
{% endembed %}

View File

@@ -0,0 +1,20 @@
<article class="post" itemscope itemtype="http://schema.org/BlogPosting" role="article">
<div class="article-item">
<header class="post-header">
{% if post.header.link %}
<h2 class="post-title" itemprop="name"><a href="{{ post.url }}" rel="bookmark" title="{{ post.title }}" itemprop="url"><i class="fa fa-angle-double-right"></i></a> <a href="{{ post.header.link }}">{{ post.title }}</a></h2>
{% else %}
<h2 class="post-title" itemprop="name"><a href="{{ post.url }}" itemprop="url">{{ post.title }}</a></h2>
{% endif %}
</header>
<section class="post-excerpt" itemprop="description">
<p>{{ post.content | striptags | truncate(200) }}</p>
</section>
<div class="post-meta">
<time datetime="{{ post.date | date(site.date_long) }}">{{ post.date | date(site.date_long) }}</time>
{% if post.taxonomy.tag|length > 0 %}
<span class="post-tags-set">{{ 'METADATA.IN_POST'|t }} {% for tag in post.taxonomy.tag %}<span class="post-tag-{{tag}}"><a href="{{ base_url }}/tag{{ config.system.param_sep }}{{ tag }}">{{ tag }}</a></span>{%if not loop.last %}, {% endif %}{% endfor %}</span>
{% endif %}
</div>
</div>
</article>

View File

@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
<head>
<meta charset="utf-8">
<!-- (1) Optimize for mobile versions: http://goo.gl/EOpFl -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- (1) force latest IE rendering engine: bit.ly/1c8EiC9 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{% if page.title %}{{ site.title }} | {{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
{% include 'partials/metadata.html.twig' %}
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="canonical" href="{{ page.url() }}">
<link rel="shortcut icon" href="{{ theme_url }}/images/favicon.png">
{% block stylesheets %}
{% do assets.addCss('theme://vendors/fonts/css/all.min.css') %}
{% do assets.addCss('theme://vendors/fontawesome/css/all.min.css') %}
{% do assets.addCss('theme://css/main.css') %}
{% do assets.addCss('theme://css/custom.css') %}
{# {% do assets.addCss('theme://css/print.css') %} #}
{% endblock %}
{% block javascripts %}
{% do assets.add('jquery', {group: 'bottom', priority: 101}) %}
{% do assets.addJs('theme://js/jquery.fitvids.js', {group: 'bottom'}) %}
{% do assets.addJs('theme://js/index.js', {group: 'bottom'}) %}
{% endblock %}
{% block assets deferred %}
{{ assets.css()|raw }}
{{ assets.js()|raw }}
{% endblock %}
</head>
{% block body %}
<body>
{% endblock %}
{% set home = pages.find(config.system.home.alias) %}
<!-- content start -->
{% block content %}
<div class="page-content">
<div class="wrapper">
{{ content|raw }}
</div>
</div>
{% endblock %}
<!-- content end -->
{% block footer %}
<!-- footer start -->
<footer class="site-footer">
<a class="subscribe" href="{{ base_url }}/blog.rss"> <span class="tooltip"> <i class="fa fa-rss"></i>{{ 'LINKS.RSS'|t }}</span></a>
<div class="inner">
<section class="copyright">{{ 'FOOTER.CONTENT'|t }} <a href="mailto:{{ site.email}}">{{ site.name }}</a> {{ "now"|date('Y') }} &bull; {{ 'FOOTER.RIGHTS'|t }} <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons BY-SA</a></section>
<section class="poweredby">{{ 'FOOTER.GRAV'|t }} <a href="http://getgrav.org" target="_blank"> Grav</a> {{ 'FOOTER.GRAV_THEME'|t }} <a href="https://git.guilo.ch/loicguib/custom-mediator-theme-grav" target="_blank"> Mediator modifié</a></section>
</div>
</footer>
<!-- footer end -->
{% endblock %}
{% block bottom %}
{{ assets.js('bottom')|raw }}
{% endblock %}
{% include 'partials/javascripts.html.twig' %}
</body>
</html>

View File

@@ -0,0 +1,15 @@
{% if base_url == '' %}
{% set base_url = '/' %}
{% endif %}
<nav class="pagination" role="navigation">
{% if pagination.hasNext %}
{% set url = (base_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}
<a class="older-posts" href="{{ url }}">&larr; {{ 'PAGINATION.OLDER'|t }}</a>
{% endif %}
<span class="page-number">Page {{ uri.currentPage }} {{ 'PAGINATION.OF'|t }} {{ pagination|length }}</span>
{% if pagination.hasPrev %}
{% set url = (base_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
<a class="newer-posts" href="{{ url }}">{{ 'PAGINATION.NEWER'|t }} &rarr;</a>
{% endif %}
</nav>

View File

@@ -0,0 +1,21 @@
<div class="post-meta">
{% if page.header.link %}
<h1 class="post-title"><i class="fa fa-angle-double-right"></i> <a href="{{ page.header.link }}">{{ page.title }}</a></h1>
{% else %}
<h1 class="post-title">{{ page.title }}</h1>
{% endif %}
{% if page.template == 'post' %}
<div class="cf post-meta-text">
<div class="author-image" style="background-image: url({{ uri.rootUrl() }}{{ site.author.image }})">{{ 'ARTICLE.AUTHOR_LOGO'|t }}</div>
<h4 class="author-name" itemprop="author" itemscope itemtype="http://schema.org/Person">{{ site.author.name }}</h4>
{{ 'METADATA.ON_POST'|t }}
<time datetime="{{ page.date | date(site.date_short) }}">{{ page.date | date(site.date_short) }}</time>
{% if page.taxonomy.tag|length > 0 %}
<span class="post-tags-set">{{ 'METADATA.IN_POST'|t }} {% for tag in page.taxonomy.tag %}<span class="post-tag-{{tag}}"><a href="{{ base_url }}/tag{{ config.system.param_sep }}{{ tag }}">{{ tag }}</a></span>{%if not loop.last %}, {% endif %}{% endfor %}</span>
{% endif %}
</div>
<div style="text-align:center">
<a href="#topofpage" class="topofpage"><i class="fa fa-angle-down"></i></a>
</div>
{% endif %}
</div>

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

@@ -0,0 +1,90 @@
{% embed 'partials/base.html.twig' %}
{% block body %}
<body itemscope itemtype="http://schema.org/Article">
{% endblock %}
{% block content %}
<main class="content {{ page.header.image ? 'tag-articleimage' : '' }}" role="main">
<article class="post">
{% if page.header.image %}
<div class="article-image">
<div class="post-image-image" style="background-image: url({% if page.header.image %}{{ page.media[page.header.image].url }}{% endif %})">
{{ 'ARTICLE.IMAGE'|t }}
</div>
{% include 'partials/postmeta.html.twig' %}
</div>
{% else %}
<div class="noarticleimage">
{% include 'partials/postmeta.html.twig' %}
</div>
<br>
<br>
<br>
{% endif %}
<section class="post-content">
<a name="topofpage"></a>
{{ content|raw }}
</section>
{% if page.template == 'post' %}
<footer class="post-footer">
<section class="share">
{% for social in site.social %}
{% if social.share_url != null %}
<a class="icon-{{ social.icon }}" href="{{ social.share_url }}{{ social.share_title }}{{page.title | escape}}{{ social.share_link }}{{site.url}}{{page.id}}"
onclick="window.open(this.href, '{{ social.icon }}-share', 'width=550,height=255');return false;">
<i class="fa fa-{{ social.icon }}"></i><span class="hidden">{{ social.icon }}</span>
</a>
{% endif %}
{% endfor %}
</section>
</footer>
<div class="bottom-teaser cf">
<div class="isLeft">
<h5 class="index-headline featured"><span>{{ 'ARTICLE.AUTHOR'|t }}</span></h5>
<section class="author">
<div class="author-image" style="background-image: url({{ uri.rootUrl() }}{{site.author.image}})">{{ 'ARTICLE.AUTHOR_LOGO'|t }}</div>
<h4>{{ site.author.name }}</h4>
<p class="bio">{{site.author.bio}}</p>
<hr>
<p class="published">{{ 'ARTICLE.PUBLISHED'|t }} <time datetime="{{ page.date | date(site.date_short) }}">{{ page.date | date(site.date_short) }}</time></p>
</section>
</div>
{# {{/post}} #}
<div class="isRight">
<h5 class="index-headline featured"><span>{{ 'ARTICLE.SUPPORTED'|t }}</span></h5>
<footer class="site-footer">
<section class="poweredby">{{ 'ARTICLE.SUPPORT_GRAV'|t }} <a href="http://getgrav.org" target="_blank"> Grav</a> {{ 'ARTICLE.SUPPORT_GRAV_THEME'|t }} <a href="https://git.guilo.ch/loicguib/custom-mediator-theme-grav" target="_blank"> Mediator modifié</a></section>
<div class="inner">
<section class="copyright">{{ 'FOOTER.CONTENT'|t }} <a href="mailto:{{ site.email}}">{{ site.name }}</a> {{ "now"|date('Y') }} &bull; {{ 'FOOTER.RIGHTS'|t }} <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons BY-SA</a></section>
<div class="inner" style="margin-top: 18px">
<a class="subscribe" href="{{ base_url_relative }}/blog.rss"> <span class="tooltip"> <i class="fa fa-rss"></i>{{ 'LINKS.RSS'|t }}</span></a>
</div>
</div>
</footer>
</div>
</div>
{% endif %}
</article>
{% include 'partials/comments.html.twig' with {'page': page} %}
</main>
<div class="bottom-closer">
<div class="background-closer-image" {% if home.header.cover %} style="background-image: url({{ home.media[home.header.cover].brightness(-75).url }})"{% endif %}>
Image
</div>
<div class="inner">
<h1 class="blog-title">{{ site.title }}</h1>
<h2 class="blog-description">{{ site.description }}</h2>
<a href="{{ home.url }}" class="btn">{{ 'LINKS.BACK_OVERVIEW'|t }}</a>
</div>
</div>
{% endblock %}
{% block footer %}{% endblock %}
{% endembed %}