dmytro_ushatenko/themes/mytheme/templates/README.html.twig

94 lines
3.7 KiB
Twig
Raw Normal View History

2020-10-01 12:52:17 +00:00
{% extends 'partials/base.html.twig' %}
{% block content %}
<article>
<section class="header">
<h1>
{% if page.header.media == 'video' %}
<i class="fa fa-file-video-o rightpad"></i>
{% else %}
<i class="fa fa-file-text-o rightpad"></i>
{% endif %}
{{ page.title|e }}
</h1>
{% if (grav.theme.config.params.articles.show.date) or (grav.theme.config.params.articles.show.authors) or (grav.theme.config.params.articles.show.topics) or (grav.theme.config.params.articles.show.time) %}
<div class="details">
{% if grav.theme.config.params.articles.show.date %}
<span>{{ page.date|date("F j, Y") }}</span>
{% endif %}
{% if grav.theme.config.params.articles.show.authors %}
{% set authorlist = [] %}
{% for author in page.taxonomy['author'] %}
{# Check to see if a dedicated author page exists #}
{% set slug = author|hyphenize|url_encode %}
{% set p = page.find('/authors/'~slug) %}
{% if p == null %}
{% set authorlist = authorlist|merge(['<a href="'~base_url~'/taxonomy?name=author&amp;val='~(author|url_encode)~'">'~author~'</a>']) %}
{% else %}
{% set authorlist = authorlist|merge(['<a href="'~base_url~'/authors/'~slug~'">'~author~'</a>']) %}
{% endif %}
{% endfor %}
<span><i class="fa fa-user"></i> {{ authorlist|join(', ') }}</span>
{% endif %}
{% if grav.theme.config.params.articles.show.topics %}
{% set catlist = [] %}
{% for cat in page.taxonomy.category %}
{% set catlist = catlist|merge(['<a href="'~base_url~'/taxonomy?name=category&amp;val='~(cat|url_encode)~'">'~cat~'</a>']) %}
{% endfor %}
<span>{{ catlist|join(', ') }}</span>
{% endif %}
{% if grav.theme.config.params.articles.show.time %}
<span>{{ page.content|readingtime }}</span>
{% endif %}
</div>
{% endif %}
2020-10-02 17:14:55 +00:00
{% if page.taxonomy.tag|length > 0 %}
{% set taglist = [] %}
{% for tag in page.taxonomy.tag %}
{% set taglist = taglist|merge(['<a href="'~base_url~'/taxonomy?name=tag&amp;val='~(tag|url_encode)~'">'~tag~'</a>']) %}
{% endfor %}
<div class="tags">
<i class="fa fa-tags rightpad"></i>{{ taglist|join(', ') }}
</div>
{% endif %}
2020-10-03 08:02:04 +00:00
{% if page.taxonomy.category|length > 0 %}
{% set categorylist = [] %}
{% for category in page.taxonomy.category %}
2020-10-03 08:04:46 +00:00
{% set categorylist = categorylist|merge(['<a href="'~base_url~'/categories/'~(category|url_encode)~'">'~category~'</a>']) %}
2020-10-03 08:02:04 +00:00
{% endfor %}
<div class="cagtegories">
<i class="fa fa-tags rightpad"></i>{{ categorylist|join(', ') }}
</div>
{% endif %}
2020-10-02 17:14:55 +00:00
{% if theme_var('display_of_git_sync_repo_link') == 'page' and not (grav.uri.param('summaryonly') or grav.uri.param('onlysummary')) %}
2020-10-03 07:53:27 +00:00
<div>{% include 'partials/git_sync_repo_link_note.html.twig' %}</dic>
2020-10-02 17:14:55 +00:00
{% endif %}
2020-10-01 12:52:17 +00:00
</section>
2020-10-02 17:14:55 +00:00
2020-10-01 12:52:17 +00:00
<section class="content">
{{ page.content }}
{% if not page.header.hide_mediasummary %}
<p></p>
{% for image in page.media.images %}
{{ image.cropResize(700, 400).html("title", "alt", "itemscreenshot") }}
{% endfor %}
{% endif %}
</section>
<section class="foot">
{% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
<div class="related topiclist">
<h2>{{ 'RELATED_ARTICLES'|t }}</h2>
{% include 'partials/relatedpages.html.twig' %}
</div>
{% endif %}
</section>
{% if config.plugins.comments.enabled %}
<section class="comments">
<h2>{{ 'COMMENTS'|t }}</h2>
</section>
{% endif %}
</article>
{% endblock %}