更新 'src/DjangoBlog-master/templates/blog/tags/sidebar.html'

fz_branch
pa2g3nmk9 6 months ago
parent 2a56350e2c
commit a645e1abce

@ -1,6 +1,10 @@
{% load blog_tags %}
{% load i18n %}
{% load blog_tags %} {# 加载自定义博客标签 #}
{% load i18n %} {# 加载国际化标签 #}
{# 侧边栏主容器 #}
<div id="secondary" class="widget-area" role="complementary">
{# 搜索组件 #}
<aside id="search-2" class="widget widget_search">
<form role="search" method="get" id="searchform" class="searchform" action="/search">
<div>
@ -10,127 +14,154 @@
</div>
</form>
</aside>
{# 自定义侧边栏内容 #}
{% if extra_sidebars %}
{% for sidebar in extra_sidebars %}
<aside class="widget_text widget widget_custom_html"><p class="widget-title">
{{ sidebar.name }}</p>
<aside class="widget_text widget widget_custom_html">
<p class="widget-title">{{ sidebar.name }}</p>
<div class="textwidget custom-html-widget">
{{ sidebar.content|custom_markdown|safe }}
{{ sidebar.content|custom_markdown|safe }} {# 使用自定义markdown解析 #}
</div>
</aside>
{% endfor %}
{% endif %}
{# 最多阅读文章 #}
{% if most_read_articles %}
<aside id="views-4" class="widget widget_views"><p class="widget-title">Views</p>
<aside id="views-4" class="widget widget_views">
<p class="widget-title">Views</p>
<ul>
{% for a in most_read_articles %}
<li>
<a href="{{ a.get_absolute_url }}" title="{{ a.title }}">
{{ a.title }}
</a> - {{ a.views }} views
</a> - {{ a.views }} views {# 显示浏览次数 #}
</li>
{% endfor %}
</ul>
</aside>
{% endif %}
{# 分类列表 #}
{% if sidebar_categorys %}
<aside id="su_siloed_terms-2" class="widget widget_su_siloed_terms"><p class="widget-title">{% trans 'category' %}</p>
<aside id="su_siloed_terms-2" class="widget widget_su_siloed_terms">
<p class="widget-title">{% trans 'category' %}</p>
<ul>
{% for c in sidebar_categorys %}
<li class="cat-item cat-item-184"><a href={{ c.get_absolute_url }}>{{ c.name }}</a>
<li class="cat-item cat-item-184">
<a href={{ c.get_absolute_url }}>{{ c.name }}</a>
</li>
{% endfor %}
</ul>
</aside>
{% endif %}
{% if sidebar_comments and open_site_comment %}
<aside id="ds-recent-comments-4" class="widget ds-widget-recent-comments"><p class="widget-title">{% trans 'recent comments' %}</p>
{# 最新评论 #}
{% if sidebar_comments and open_site_comment %} {# 检查评论功能是否开启 #}
<aside id="ds-recent-comments-4" class="widget ds-widget-recent-comments">
<p class="widget-title">{% trans 'recent comments' %}</p>
<ul id="recentcomments">
{% for c in sidebar_comments %}
<li class="recentcomments">
<span class="comment-author-link">
{{ c.author.username }}</span>
{% trans 'published on' %}《
<span class="comment-author-link">{{ c.author.username }}</span>
{% trans 'published on' %}《 {# 翻译:"发表于" #}
<a href="{{ c.article.get_absolute_url }}#comment-{{ c.pk }}">{{ c.article.title }}</a>
</li>
{% endfor %}
</ul>
</aside>
{% endif %}
{# 最新文章 #}
{% if recent_articles %}
<aside id="recent-posts-2" class="widget widget_recent_entries"><p class="widget-title">{% trans 'recent articles' %}</p>
<aside id="recent-posts-2" class="widget widget_recent_entries">
<p class="widget-title">{% trans 'recent articles' %}</p>
<ul>
{% for a in recent_articles %}
<li><a href="{{ a.get_absolute_url }}" title="{{ a.title }}">
{{ a.title }}
</a></li>
{% for a in recent_articles %}
<li>
<a href="{{ a.get_absolute_url }}" title="{{ a.title }}">
{{ a.title }}
</a>
</li>
{% endfor %}
</ul>
</aside>
{% endif %}
{# 书签链接 #}
{% if sidabar_links %}
<aside id="linkcat-0" class="widget widget_links"><p class="widget-title">{% trans 'bookmark' %}</p>
<aside id="linkcat-0" class="widget widget_links">
<p class="widget-title">{% trans 'bookmark' %}</p>
<ul class='xoxo blogroll'>
{% for l in sidabar_links %}
<li>
<a href="{{ l.link }}" target="_blank" title="{{ l.name }}">{{ l.name }}</a>
</li>
{% endfor %}
</ul>
</aside>
{% endif %}
{# Google广告 #}
{% if show_google_adsense %}
<aside id="text-2" class="widget widget_text"><p class="widget-title">Google AdSense</p>
<aside id="text-2" class="widget widget_text">
<p class="widget-title">Google AdSense</p>
<div class="textwidget">
{{ google_adsense_codes|safe }}
{{ google_adsense_codes|safe }} {# 安全输出广告代码 #}
</div>
</aside>
{% endif %}
{# 标签云 #}
{% if sidebar_tags %}
<aside id="tag_cloud-2" class="widget widget_tag_cloud"><p class="widget-title">{% trans 'Tag Cloud' %}</p>
<aside id="tag_cloud-2" class="widget widget_tag_cloud">
<p class="widget-title">{% trans 'Tag Cloud' %}</p>
<div class="tagcloud">
{% for tag,count,size in sidebar_tags %}
{% for tag,count,size in sidebar_tags %} {# 标签、数量、字体大小 #}
<a href="{{ tag.get_absolute_url }}"
class="tag-link-{{ tag.id }} tag-link-position-{{ tag.id }}"
style="font-size: {{ size }}pt;" title="{{ count }}个话题"> {{ tag.name }}
style="font-size: {{ size }}pt;"
title="{{ count }}个话题"> {{ tag.name }}
</a>
{% endfor %}
</div>
</aside>
{% endif %}
<aside id="text-2" class="widget widget_text"><p class="widget-title">{% trans 'Welcome to star or fork the source code of this site' %}</p>
{# GitHub项目信息 #}
<aside id="text-2" class="widget widget_text">
<p class="widget-title">{% trans 'Welcome to star or fork the source code of this site' %}</p>
<div class="textwidget">
<p><a href="https://github.com/liangliangyy/DjangoBlog" rel="nofollow"><img
src="https://resource.lylinux.net/img.shields.io/github/stars/liangliangyy/djangoblog.svg?style=social&amp;label=Star"
alt="GitHub stars"></a> <a href="https://github.com/liangliangyy/DjangoBlog" rel="nofollow"><img
src="https://resource.lylinux.net/img.shields.io/github/forks/liangliangyy/djangoblog.svg?style=social&amp;label=Fork"
alt="GitHub forks"></a></p>
<p>
<a href="https://github.com/liangliangyy/DjangoBlog" rel="nofollow">
<img src="https://resource.lylinux.net/img.shields.io/github/stars/liangliangyy/djangoblog.svg?style=social&amp;label=Star" alt="GitHub stars">
</a>
<a href="https://github.com/liangliangyy/DjangoBlog" rel="nofollow">
<img src="https://resource.lylinux.net/img.shields.io/github/forks/liangliangyy/djangoblog.svg?style=social&amp;label=Fork" alt="GitHub forks">
</a>
</p>
</div>
</aside>
<aside id="meta-3" class="widget widget_meta"><p class="widget-title">{% trans 'Function' %}</p>
{# 功能链接 #}
<aside id="meta-3" class="widget widget_meta">
<p class="widget-title">{% trans 'Function' %}</p>
<ul>
<li><a href="/admin/" rel="nofollow">{% trans 'management site' %}</a></li>
{# 根据登录状态显示不同链接 #}
{% if user.is_authenticated %}
<li><a href="{% url "account:logout" %}" rel="nofollow">{% trans 'logout' %}</a>
</li>
<li><a href="{% url "account:logout" %}" rel="nofollow">{% trans 'logout' %}</a></li>
{% else %}
<li><a href="{% url "account:login" %}" rel="nofollow">{% trans 'login' %}</a></li>
{% endif %}
{# 超级用户专属功能 #}
{% if user.is_superuser %}
<li><a href="{% url 'owntracks:show_dates' %}" target="_blank">{% trans 'Track record' %}</a></li>
{% endif %}
<li><a href="http://gitbook.lylinux.net" target="_blank" rel="nofollow">GitBook</a></li>
</ul>
</aside>
{# 返回顶部按钮 #}
<div id="rocket" class="show" title="{% trans 'Click me to return to the top' %}"></div>
</div><!-- #secondary -->
Loading…
Cancel
Save