Autoformatted some twigs

This commit is contained in:
pikim 2023-01-19 23:01:41 +01:00
parent 0cd5ea1b28
commit e970f998e4
6 changed files with 234 additions and 222 deletions

View file

@ -5,8 +5,7 @@
<div class="title">
<h2>{{ page.header.title }}</h2>
</div>
<div class="meta">
</div>
<div class="meta"></div>
</header>
{{ content|raw }}
{% include "forms/form.html.twig" %}

View file

@ -5,13 +5,11 @@
{% set input = attribute(field, "input@") %}
{% if input is null or input == true %}
{% if form.value(scope ~ field.name) %}
{% block field %}
<div>
{% block field_name %}
<strong>{{ field.name|t|e }}</strong>:
{% endblock %}
{% block field_value %}
@ -48,4 +46,3 @@
{% import _self as macro %}
{{ macro.render_field(form, form.fields, '') }}

View file

@ -1,7 +1,6 @@
<section>
<ul class="posts">
{% for p in page.find(theme_config.blog_page).children.order('date', 'desc').slice(0, 5) %}
{% if p.header.primaryImage %}
{% set bannerimage = p.media[p.header.primaryImage]%}
{% else %}
@ -10,7 +9,9 @@
<li>
<article>
<header>
<h3><a href="{{p.url}}">{{ p.title }}</a></h3>
<h3>
<a href="{{p.url}}">{{ p.title }}</a>
</h3>
{% if plugin.translate_date.enabled %}
<time class="published" datetime="{{ p.date|td(null, "Y-m-d") }}">{{ p.date|td }}</time>
{% else %}

View file

@ -7,13 +7,17 @@
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
<head>
{% block head deferred %}
<title>{% if page.title %}{{ page.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
<meta charset="utf-8" />
<title>
{% if page.title %}
{{ page.title|e('html') }}
{% endif %}
{{ site.title|e('html') }}</title>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes"/>
{% include 'partials/metadata.html.twig' %}
<link rel="icon" type="{{ favicon.type }}" href="{{ url( favicon.path ) }}"/>
<link rel="canonical" href="{{ page.url(true, true) }}" />
<link rel="canonical" href="{{ page.url(true, true) }}"/>
{% endblock head %}
{% block stylesheets %}
@ -41,7 +45,8 @@
{{ assets.js()|raw }}
</head>
<body class="is-preload">
<body
class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
@ -62,7 +67,9 @@
{% endblock %}
<a id="back-to-top" href="#"><i class="fa fa-chevron-up"></i></a>
<a id="back-to-top" href="#">
<i class="fa fa-chevron-up"></i>
</a>
{% block bottom %}
{{ assets.js('bottom')|raw }}

View file

@ -22,7 +22,9 @@
<a href="{{ page.header.link }}">{{ page.title }}</a>
</h2>
{% else %}
<h2 itemprop="headline"><a href="{{ page.url }}">{{ page.title }}</a></h2>
<h2 itemprop="headline">
<a href="{{ page.url }}">{{ page.title }}</a>
</h2>
{% endif %}
{% if page.header.subtitle %}
<p itemprop="alternativeHeadline">{{ page.header.subtitle|raw }}</p>
@ -35,7 +37,10 @@
<time class="published" itemprop="datePublished" datetime="{{ page.date|date("Y-m-d") }}">{{ page.date|date("M j, Y") }}</time>
{% endif %}
{% if author %}
<a href="{{ base_url }}/author{{ config.system.param_sep }}{{ author }}" itemprop="keywords" class="author">{{ tag }}<span class="name" rel="author">{{ author }}</span>{% if page.header.avatarImage %}<img src="{{ page.media[page.header.avatarImage].url|e}}" alt="{{ author }}" />{% endif %}</a>
<a href="{{ base_url }}/author{{ config.system.param_sep }}{{ author }}" itemprop="keywords" class="author">{{ tag }}<span class="name" rel="author">{{ author }}</span>
{% if page.header.avatarImage %}<img src="{{ page.media[page.header.avatarImage].url|e}}" alt="{{ author }}"/>
{% endif %}
</a>
{% endif %}
</div>
</header>
@ -47,7 +52,6 @@
{% endif %}
<div itemprop="articleBody">
{% if page.header.continue_link is sameas(false) %}
{{ page.content|raw }}
{% if not truncate %}
@ -61,7 +65,6 @@
{{ page.content|raw }}
{% set show_prev_next = true %}
{% endif %}
</div>
<footer>
@ -74,12 +77,19 @@
{% if show_prev_next %}
{% if not page.isLast %}
<li><a class="button" href="{{ page.prevSibling.url }}"><i class="fa fa-chevron-left"></i> {{'FUTURE.BLOG.ITEM.PREV_POST'|t}}</a></li>
<li>
<a class="button" href="{{ page.prevSibling.url }}">
<i class="fa fa-chevron-left"></i>
{{'FUTURE.BLOG.ITEM.PREV_POST'|t}}</a>
</li>
{% endif %}
{% if not page.isFirst %}
<li><a class="button" href="{{ page.nextSibling.url }}">{{'FUTURE.BLOG.ITEM.NEXT_POST'|t}} <i class="fa fa-chevron-right"></i></a></li>
<li>
<a class="button" href="{{ page.nextSibling.url }}">{{'FUTURE.BLOG.ITEM.NEXT_POST'|t}}
<i class="fa fa-chevron-right"></i>
</a>
</li>
{% endif %}
{% endif %}
</ul>
@ -89,10 +99,8 @@
<li><a href="{{ base_url }}/tag{{ config.system.param_sep }}{{ tag }}" itemprop="keywords">{{ tag }}</a></li>
{% endfor %}
{% endif %}
<li><a href="https://twitter.com/share" data-url="{{ page.url(true) }}" data-text="{{ page.title }}" class="icon brands fa-twitter">
</a></li>
<li><a href="http://www.facebook.com/sharer.php?u={{ page.url(true) }}" class="icon brands fa-facebook">
</a></li>
<li><a href="https://twitter.com/share" data-url="{{ page.url(true) }}" data-text="{{ page.title }}" class="icon brands fa-twitter"></a></li>
<li><a href="http://www.facebook.com/sharer.php?u={{ page.url(true) }}" class="icon brands fa-facebook"></a></li>
</ul>
</footer>
</footer>
</article>