Добавление блока социальных кнопок [closes #32]

master
Антон Касимов 2019-05-18 00:13:09 +03:00
parent 46318a04b4
commit d82fbb0f00
5 changed files with 36 additions and 17 deletions

View File

@ -5,16 +5,16 @@
<subtitle type="html">{{subtitle}}</subtitle>
{%- endif %}
<link rel="self" href="{{request.path_qs}}"/>
{%- if alternate %}
<link rel="alternate" type="text/html" hreflang="{{request.locale_name}}" href="{{alternate}}"/>
{%- if 'links' in feed and feed['index'] %}
<link rel="alternate" type="text/html" hreflang="{{request.locale_name}}" href="{{feed['links']['index']}}"/>
{%- endif %}
<updated>{{(pages[0][1].page['updated'] or pages[0][1].page['published']).isoformat()}}+00:00</updated>
<id>urn:uuid:{{id}}</id>
<id>urn:uuid:{{feed['id']}}</id>
<author>
<name>{{author['name']}}</name>
<name>{{feed['author']['name']}}</name>
</author>
{%- if category %}
<category term="{{category}}"/>
{%- if feed['category'] %}
<category term="{{feed['category']}}"/>
{%- endif %}
<generator uri="https://trac.radium.group/flatfilecms/" version="1.0">flatfilecms</generator>
{%- for item in pages %}

View File

@ -2,19 +2,19 @@
<!DOCTYPE html>
<html lang="{{request.locale_name}}">
<head>
{% block head -%}
{%- block head %}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{description}}">
<meta name="generator" content="flatfilecms">
<link rel="icon" type="image/png" href="/static/img/favicon.png">
{% if amphtml is defined -%}
{%- if amphtml is defined %}
<link rel="amphtml" href="{{amphtml}}">
{% endif -%}
{% for link in alternate -%}
<link rel="alternate" type="{{link.type}}" title="{{link.title}}" href="{{link.href}}">
{% endfor -%}
{%- endif %}
{%- if feed is defined %}
<link rel="alternate" type="application/atom+xml" title="Atom feed" href="{{feed['links']['atom']}}">
{%- endif %}
<title>{{title}}</title>
{% block links %}
{%- endblock %}

View File

@ -1,5 +1,5 @@
{% extends "layout.jinja2" %}
{% if header_class is not defined %}{% set header_class="light" %}{%endif%}
{%- if header_class is not defined %}{% set header_class="light" %}{%endif%}
{% block content %}
<div class="card-columns">
{% for item in pages %}
@ -17,8 +17,4 @@
</div>
{% endfor %}
</div>
{% set atom_feed = alternate|selectattr('type', 'equalto', 'application/atom+xml')|first -%}
{% if atom_feed -%}
<p>Подписаться на обновления: <a href="{{atom_feed.href}}"><i class="fas fa-rss"></i></a></p>
{% endif -%}
{% endblock %}

View File

@ -0,0 +1,22 @@
{%- if feed is defined and 'links' in feed %}
<div class="text-center mb-4">
<p>Лента сообщений в удобном формате:</p>
<div class="btn-group" role="group" aria-label="Feed links">
{%- if 'index' in feed['links'] %}
<a href="{{feed['links']['index']}}" class="btn btn-secondary" role="button"><i class="fas fa-newspaper"></i></a>
{%- endif %}
{%- if 'atom' in feed['links'] %}
<a href="{{feed['links']['atom']}}" class="btn btn-secondary" role="button"><i class="fas fa-rss"></i></a>
{%- endif %}
{%- if 'twitter' in feed['links'] %}
<a href="https://twitter.com/{{feed['links']['twitter']}}" class="btn btn-secondary" role="button"><i class="fab fa-twitter"></i></a>
{%- endif %}
{%- if 'telegram' in feed['links'] %}
<a href="https://t.me/{{feed['links']['telegram']}}" class="btn btn-secondary" role="button"><i class="fab fa-telegram"></i></a>
{%- endif %}
{%- if 'facebook' in feed['links'] %}
<a href="https://fb.me/{{feed['links']['facebook']}}" class="btn btn-secondary" role="button"><i class="fab fa-facebook"></i></a>
{%- endif %}
</div>
</div>
{%- endif %}

View File

@ -20,6 +20,7 @@
{% endblock %}
</article>
</main>
{%- include 'feedlinks.jinja2' %}
<footer class="page-footer">
{% include "footer.jinja2" %}
</footer>