2021-05-10 12:01:19 +00:00
title = "Пост"
url = "/post/:id/:slug"
layout = "cms"
is_hidden = 0
2021-11-01 12:34:49 +00:00
seo_keywords = "Türkmenistan, Turkmenistan, Туркменистан, Ориент новости, Orient news, Orienttm, Turkmen habarlary, Turkmen habarlar, Turkmen news, Новости Туркменистана, Новости СНГ, Новости средней азии, Новости Центральной Азии,"
2021-05-10 12:01:19 +00:00
robot_index = "index"
robot_follow = "follow"
[viewBag]
localeTitle[en] = "Post"
[blogPost]
slug = "{{ :slug }}"
id = "{{ :id }}"
categoryPage = "blog/category"
[views]
slug = "{{ :slug }}"
2021-05-21 07:27:29 +00:00
[SeoBlogPost]
post = "post"
2021-05-10 12:01:19 +00:00
==
2021-11-24 12:28:48 +00:00
< style >
.main {
margin-top: 45px;
}
.news__image {
width: 100%;
margin: 20px 0;
display: block;
}
.news__date {
display: flex;
align-items: center;
font-size: 20px;
line-height: 26px;
color: #a2a2a2;
font-weight: 400;
margin-bottom: 5px;
}
.news__sidebar .card {
padding: 18px 0;
border-bottom: 1px solid #dcdcdc;
}
.card__header-view svg {
margin-right: 5px;
stroke: #a2a2a2;
width: 21px;
height: 15px;
}
< / style >
2021-05-21 07:27:29 +00:00
{% component 'SeoBlogPost' %}
2021-05-10 12:01:19 +00:00
< article class = "news__content" >
< header >
< div class = "news__content-header" >
< time class = "news__date" >
< span > {{post.published_at|date('d.m.Y')}}< / span >
< svg xmlns = "http://www.w3.org/2000/svg" width = "4" height = "4" viewBox = "0 0 4 4" >
2021-12-17 14:50:25 +00:00
< path data-name = "Polygon 1" d = "M2,0,4,2,2,4,0,2Z" fill = "#a2a2a2" / >
2021-05-10 12:01:19 +00:00
< / svg >
< span > {{post.published_at|date('H:i')}}< / span >
< / time >
< div class = "card__header-view" id = "view" >
< svg xmlns = "http://www.w3.org/2000/svg" >
< g id = "eye" transform = "translate(-0.5 -3.5)" >
< path id = "Path_6489" data-name = "Path 6489"
d="M1,11S4.636,4,11,4s10,7,10,7-3.636,7-10,7S1,11,1,11Z" fill="none" stroke=""
stroke-linecap="round" stroke-linejoin="round" stroke-width="1">< / path >
< ellipse id = "Ellipse_12" data-name = "Ellipse 12" cx = "4.859" cy = "4.791" rx = "4.859" ry = "4.791"
transform="translate(6.141 6.209)" fill="none" stroke="" stroke-linecap="round"
stroke-linejoin="round" stroke-width="1">< / ellipse >
< / g >
< / svg >
{% partial 'view' %}
< / div >
< / div >
< h1 class = "news__title" >
{{post.title}}
< / h1 >
{% if post.featured_image %}
< picture class = "news__image" >
2021-06-04 12:38:17 +00:00
< soruce media = "(min-width: 1024px)" srcset = "{{post.featured_image|media_cdn}}" >
< soruce media = "(min-width: 768px)" srcset = "{{post.featured_image|media_cdn|resize(720)}}" >
< soruce srcset = "{{post.featured_image|media_cdn|resize(400)}}" >
< img src = "{{post.featured_image|media_cdn}}" alt = "{{post.title}}" >
2021-05-10 12:01:19 +00:00
< / picture >
{% endif %}
< / header >
< div class = "news__body" >
{{post.content|md}}
2021-05-24 11:18:16 +00:00
2021-05-10 12:01:19 +00:00
< / div >
< div class = "news__footer" >
< div class = "news__footer-social" >
{% partial 'social' %}
< / div >
2021-05-24 11:18:16 +00:00
< div class = "news__footer-name" >
{% if post.author %}
2021-05-24 11:21:59 +00:00
< p > < em > < strong > {{post.author}}< / strong > < / em > < / p >
2021-05-24 11:18:16 +00:00
{% endif %}
< / div >
2021-05-10 12:01:19 +00:00
< / div >
< / article >
< div class = "news__sidebar" >
{% partial 'latest_news'%}
< / div >
{% put scripts %}
< script >
$.request('views::onIncrement', {
update: { view: '@#view' },
})
var re = /\[video poster=\"(.+?)\".+?mp4=\"(.+?)\"/g;
// re = /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/g
2021-05-24 11:18:16 +00:00
var ptags = document.querySelectorAll('p');
2021-05-10 12:01:19 +00:00
2021-05-24 11:18:16 +00:00
ptags.forEach(s => {
2021-05-10 12:01:19 +00:00
var m;
m = re.exec(s.innerText);
if (m) {
2021-05-24 11:18:16 +00:00
var video = document.createElement('video');
video.setAttribute('src', m[2]);
video.setAttribute('controls', "")
video.setAttribute('width', "100%")
video.setAttribute('type', "video/mp4")
video.setAttribute('poster', m[1])
s.parentNode.replaceChild(video, s);
2021-05-10 12:01:19 +00:00
}
});
< / script >
2021-12-17 14:50:25 +00:00
{% endput %}