You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DjangoBlog-Maintenance-Anal.../src/links_list.html

56 lines
2.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{# 继承基础模板 #}
{% extends 'share_layout/base.html' %}
{% load blog_tags %}
{# 加载自定义的blog_tags模板标签库后续可调用库中定义的自定义标签 #}
{% load cache %}
{% block header %}
<title>友情链接 | {{ SITE_DESCRIPTION }}</title>
<meta name="description" content="{{ SITE_SEO_DESCRIPTION }}"/>
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/>
{# Open GraphOG协议标签指定内容类型为“博客”用于社交平台如微信、微博分享时识别内容类型 #}
<meta property="og:type" content="blog"/>
{# OG标签社交分享时显示的标题使用项目全局配置的站点名称SITE_NAME #}
<meta property="og:title" content="{{ SITE_NAME }}"/>
{# OG标签社交分享时显示的描述使用站点全局描述SITE_DESCRIPTION #}
<meta property="og:description" content="{{ SITE_DESCRIPTION }}"/>
{# OG标签社交分享时关联的页面URL使用项目全局配置的基础域名SITE_BASE_URL #}
<meta property="og:url" content="{{ SITE_BASE_URL }}"/>
{# OG标签社交分享时显示的站点名称与SITE_NAME保持一致 #}
<meta property="og:site_name" content="{{ SITE_NAME }}"/>
{% endblock %}
{# 定义页面主要内容content承载“友情链接列表”的核心展示逻辑 #}
{% block content %}
{# 主要内容外层容器通过idprimary和classsite-content控制样式确保与站点整体布局统一 #}
<div id="primary" class="site-content">
<div id="content" role="main">
<header class="archive-header">
<p class="archive-title">友情链接</p>
</header><!-- .archive-header -->
<div class="entry-content">
<ul>
{# 循环遍历友情链接数据列表object_list为视图传递的查询集包含所有友情链接对象 #}
{% for obj in object_list %}
{# 单个友情链接项li每个项对应一条友情链接 #}
<li>
<a href="{{ obj.link }}">{{ obj.name }}</a>
</li>
{% endfor %} </ul>
</div>
</div><!-- #content -->
</div><!-- #primary -->
{% endblock %}
{# 定义页面侧边栏sidebar内容块加载站点侧边栏组件 #}
{% block sidebar %}
{% load_sidebar user 'i' %}
{% endblock %}