mod: Шаблоны в современном ситиле + schema.org

This commit is contained in:
2026-02-18 18:52:22 +03:00
parent 7e33997260
commit d1eb218986
6 changed files with 198 additions and 63 deletions

View File

@@ -1,52 +1,92 @@
{% extends "base.html" %}
{% load static %}
{% block Date4Meta %}{{ DQ.dtCreated|date:"c" }}{% endblock %}
{% block Last4Meta %}{{ DQ.dtEdited|date:"c" }}{% endblock %}
{% block Expires4Meta %}{% now "c" %}{% endblock %}"
{% block Last4Meta %}{{ DQ.dtEdited|date:"Y-m-d" }}{% endblock %}
{% block Description %}{% if DQ.szIntro %}{{ DQ.szIntro }} {% endif %}{{ DQ.szContent }}{% if AUTHOR.szAuthor %} ({{ AUTHOR.szAuthor }}){% endif %}{% endblock %}
{% block Description %}{% if DQ.szIntro %}{{ DQ.szIntro }} {% endif %}{{ DQ.szContent }}{% if AUTHOR %} ({{ AUTHOR.szAuthor }}){% endif %}{% endblock %}
{% block Keywords %}Цитаты, {% for i in TAGS %}{{ i.name|safe }}, {% endfor %}Высказвания{% endblock %}
{% block CopyrightAuthor4Meta %}{% if AUTHOR.szAuthor %}, {{ AUTHOR.szAuthor }} (слова){% endif %}{% endblock %}
{% block CopyrightAuthor4Meta %}{% if AUTHOR %}, {{ AUTHOR.szAuthor }} (слова){% endif %}{% endblock %}
<!--- ТИТУЛ --->
{% block Title %}DQ: {{ DQ.szContent }}{% if AUTHOR.szAuthor %} ({{ AUTHOR.szAuthor }}){% endif %}{% endblock %}
{% block Title %}DQ: {{ DQ.szContent }}{% if AUTHOR %} ({{ AUTHOR.szAuthor }}){% endif %}{% endblock %}
{% block Top_JS1 %}{% endblock %}
{% block ExtraHead %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CreativeWork",
"name": "Dictum & Quotes #{{ DQ.id }}",
"text": "{{ DQ.szContent|escapejs }}",
{% if AUTHOR %}"author": {
"@type": "Person",
"name": "{{ AUTHOR.szAuthor|escapejs }}"
},{% endif %}
{% if IMAGE %}"image": "{{ request.scheme }}://{{ request.get_host }}{{ IMAGE.url }}",{% endif %}
"keywords": "{% for i in TAGS %}{{ i.name|escapejs }}{% if not forloop.last %}, {% endif %}{% endfor %}",
"inLanguage": "ru",
"dateCreated": "{{ DQ.dtCreated|date:'Y-m-d' }}",
"dateModified": "{{ DQ.dtEdited|date:'Y-m-d' }}"
}
</script>
{% endblock %}
{% block Top_JS2 %}{% endblock %}
{% block Top_JS3 %}{% endblock %}
{% block CONTENT %}{% include "blocks/header_nav.html" %}
<center><table style="height:80vh;">
<tr>
<td>
<div class="container main-content">
<!-- Основной контент: Текст + Картинка -->
<div class="content-row">
<!-- Текстовая колонка -->
<div class="text-col">
<!-- Интро/Вступление -->
{% if DQ.szIntroHTML %}
<div id="info">{{ DQ.szIntroHTML|safe }}</div>
<div id="bb">{{ DQ.szContentHTML|safe }}</div>
<div id="author">{{ AUTHOR.szAuthorHTML|safe }}</div>
</td>{% if IMAGE %}<td id="image">
<center><div style="background:rgba({% for i in CLR %}{% if forloop.counter <= 3 %}{{ i|stringformat:"02d" }}{% if forloop.counter < 3 %},{%endif %}{% endif %}{% empty %}87,00,00{% endfor %},0.7);">
<div><img src="{{IMAGE.url}}" alt="{{ AUTHOR.szAuthor }}" title="{{ AUTHOR.szAuthor }}" /></div>
</div></center>
</td></tr><tr><td colspan="2">{% else %}</tr><tr><td>{% endif %}
<div class="tags">
{% for i in TAGS %}<a href="/?tag={{ i.slug }}">{{ i.name|safe }}</a> {% endfor %}
<div id="next"><a href="/{{ NEXT }}_{{ NEXT_TXT }}">&rightarrow;</a></div>
{% endif %}
<!-- Цитата: Семантический blockquote -->
<blockquote id="bb" style="border:none; margin:0; padding:0;">
{{ DQ.szContentHTML|safe }}
</blockquote>
<!-- Автор: Семантический cite -->
<div id="author">
<cite>
{% if AUTHOR %}
{{ AUTHOR.szAuthorHTML|default:AUTHOR.szAuthor|safe }}
{% endif %}
</cite>
</div>
</td>
</tr>
</table></center>
</div>
<!-- Колонка с картинкой (если есть) -->
{% if IMAGE %}
<div class="image-col" id="image">
<center>
<div style="background:rgba({% for i in CLR %}{% if forloop.counter <= 3 %}{{ i|stringformat:"02d" }}{% if forloop.counter < 3 %},{%endif %}{% endif %}{% empty %}87,00,00{% endfor %},0.7);">
<div><img src="{{IMAGE.url}}" alt="{% if AUTHOR %}{{ AUTHOR.szAuthor }}{% else %}Dictum & Quotes{% endif %}" title="{% if AUTHOR %}{{ AUTHOR.szAuthor }}{% else %}Dictum & Quotes{% endif %}" /></div>
</div>
</center>
</div>
{% endif %}
</div>
<!-- Блок тегов и навигации -->
<div class="tags">
{% for i in TAGS %}<a href="/?tag={{ i.slug }}">{{ i.name|safe }}</a> {% endfor %}
<div id="next"><a href="/{{ NEXT }}_{{ NEXT_TXT }}{% if CURRENT_TAG %}?tag={{ CURRENT_TAG }}{% endif %}">&rightarrow;</a></div>
</div>
</div>
<script type="text/javascript">
setTimeout('location.replace("/{{ NEXT }}_{{ NEXT_TXT }}")', 15000);
setTimeout('location.replace("/{{ NEXT }}_{{ NEXT_TXT }}{% if CURRENT_TAG %}?tag={{ CURRENT_TAG }}{% endif %}")', 15000);
/*Изменить текущий адрес страницы через 3 секунды (3000 миллисекунд)*/
</script>
<noscript>
<meta http-equiv="refresh" content="15; url=/{{ NEXT}}_{{ NEXT_TXT }}">
<meta http-equiv="refresh" content="15; url=/{{ NEXT}}_{{ NEXT_TXT }}{% if CURRENT_TAG %}?tag={{ CURRENT_TAG }}{% endif %}">
</noscript>