mod: Улучшены SEO и LLMO

This commit is contained in:
2026-02-19 12:28:45 +03:00
parent e4dcfdbfed
commit e26e97add7
3 changed files with 40 additions and 25 deletions

View File

@@ -7,12 +7,18 @@
width="50" height="46"/>
</a>
<div>
<nobr id="stats-menu" style="display: none; color: silver; font-size: 0.9em; margin-right: 15px;">
{% if ticks %}<i class="stats-icon icon-time" title="Generation time"></i> {{ ticks|floatformat:1 }}ms{% endif %}
{% if DQ %} &nbsp; | &nbsp; <i class="stats-icon icon-views" title="Views"></i> {{ DQ.iViewCounter }}{% endif %}
&nbsp; | &nbsp; <a href="/add_quote/" style="color: silver; text-decoration: none;" title="Добавить цитату">Добавить цитату</i></a> &nbsp; |
</nobr>
<a href="#" onclick="var m=document.getElementById('stats-menu'); m.style.display = (m.style.display === 'none' ? 'inline' : 'none'); return false;" style="color: silver; text-decoration: none; font-size: 1.2em;"></a>
<span id="stats-menu" style="display: none; color: silver; font-size: 0.9em; margin-right: 15px; text-align: right;">
<!-- Манифест проекта -->
<div style="margin-bottom: 5px; color: #aaa; font-style: italic; max-width: 300px; display: inline-block;">
Dicquo&nbsp;— это коллекция отобранных вручную цитат, оформленных с&nbsp;уважением к&nbsp;типографике. Место для&nbsp;вдумчивого чтения.
</div>
<br/>
<!-- Статистика -->
{% if ticks %}<i class="stats-icon icon-time" title="Время генерации"></i>{{ ticks|floatformat:1 }}ms{% endif %}
{% if DQ %} &nbsp;|&nbsp; <i class="stats-icon icon-views" title="Просмотры"></i>{{ DQ.iViewCounter }}{% endif %}
&nbsp;|&nbsp; <a href="/add_quote/" style="color: silver; text-decoration: none;" title="Добавить цитату"><i class="stats-icon icon-add"></i></a> &nbsp;|&nbsp;
</span>
<a href="#" onclick="var m=document.getElementById('stats-menu'); m.style.display = (m.style.display === 'none' ? 'inline-block' : 'none'); return false;" style="color: silver; text-decoration: none; font-size: 1.2em;"></a>
</div>
</header>
</div>

View File

@@ -3,30 +3,36 @@
{% block Last4Meta %}{{ DQ.dtEdited|date:"Y-m-d" }}{% endblock %}
{% block Description %}{% if DQ.szIntro %}{{ DQ.szIntro }} {% endif %}{{ DQ.szContent }}{% if AUTHOR %} ({{ AUTHOR.szAuthor }}){% endif %}{% endblock %}
{% block Description %}{% if AUTHOR %}{{ AUTHOR.szAuthor }}: {% endif %}{% if DQ.szIntro %}{{ DQ.szIntro }} {% endif %}{{ DQ.szContent|truncatewords:20 }} — Читайте вдумчивые цитаты и афоризмы на Dicquo.{% endblock %}
{% block Keywords %}Цитаты, {% for i in TAGS %}{{ i.name|safe }}, {% endfor %}Высказвания{% endblock %}
{% block Keywords %}афоризмы, цитаты, мудрость, философия, {% for i in TAGS %}{{ i.name|safe }}, {% endfor %}высказывания{% endblock %}
{% block CopyrightAuthor4Meta %}{% if AUTHOR %}, {{ AUTHOR.szAuthor }} (слова){% endif %}{% endblock %}
{% block CopyrightAuthor4Meta %}{% if AUTHOR %}, {{ AUTHOR.szAuthor }} (автор){% endif %}{% endblock %}
<!--- ТИТУЛ --->
{% block Title %}DQ: {{ DQ.szContent }}{% if AUTHOR %} ({{ AUTHOR.szAuthor }}){% endif %}{% endblock %}
{% block Title %}{% if AUTHOR %}{{ AUTHOR.szAuthor }}{% endif %}{{ DQ.szContent|truncatewords:7 }} | Dicquo{% endblock %}
{% block ExtraHead %}
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CreativeWork",
"name": "Dictum & Quotes #{{ DQ.id }}",
"@type": "Quotation",
"name": "Цитата #{{ DQ.id }}",
"text": "{{ DQ.szContent|escapejs }}",
{% if AUTHOR %}"author": {
"creator": {
"@type": "Person",
"name": "{{ AUTHOR.szAuthor|escapejs }}"
},{% endif %}
"name": "{% if AUTHOR %}{{ AUTHOR.szAuthor|escapejs }}{% else %}Неизвестный автор{% endif %}"
},
"url": "{{ request.build_absolute_uri }}",
{% 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 %}",
"keywords": "афоризмы, цитаты, {% for i in TAGS %}{{ i.name|escapejs }}{% if not forloop.last %}, {% endif %}{% endfor %}",
"inLanguage": "ru",
"isPartOf": {
"@type": "WebSite",
"name": "Dicquo",
"url": "{{ request.scheme }}://{{ request.get_host }}"
},
"dateCreated": "{{ DQ.dtCreated|date:'Y-m-d' }}",
"dateModified": "{{ DQ.dtEdited|date:'Y-m-d' }}"
}

View File

@@ -68,7 +68,9 @@ document.addEventListener("DOMContentLoaded", function() {
document.body.addEventListener('click', function(e) {
// Find if a link was clicked (bubble up)
const link = e.target.closest('a');
if (link && link.href && link.target !== '_blank' && !link.href.startsWith('#') && !link.href.includes('javascript:')) {
if (link && link.href && link.target !== '_blank') {
const hrefAttr = link.getAttribute('href');
if (hrefAttr && !hrefAttr.startsWith('#') && !link.href.includes('javascript:')) {
// Check if it is an internal link (same domain)
if (new URL(link.href).origin === window.location.origin) {
e.preventDefault(); // Stop immediate navigation
@@ -80,6 +82,7 @@ document.addEventListener("DOMContentLoaded", function() {
}, 900);
}
}
}
});
// 8. Auto-redirect ("meditative" slideshow)