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.
187 lines
6.9 KiB
187 lines
6.9 KiB
{% load static %}
|
|
{% load cache %}
|
|
{% load i18n %}
|
|
{% load compress %}
|
|
<!DOCTYPE html>
|
|
<!--[if IE 7]>
|
|
<html class="ie ie7" lang="zh-CN"
|
|
prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
|
|
<![endif]-->
|
|
<!--[if IE 8]>
|
|
<html class="ie ie8" lang="zh-CN"
|
|
prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
|
|
<![endif]-->
|
|
<!--[if !(IE 7) & !(IE 8)]><!-->
|
|
<html lang="zh-CN" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
|
|
<!--<![endif]-->
|
|
<head>
|
|
<meta charset="UTF-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<meta name="format-detection" content="telephone=no"/>
|
|
<meta name="theme-color" content="#21759b"/>
|
|
|
|
{% load blog_tags %}
|
|
{% head_meta %}
|
|
|
|
{% block header %}
|
|
<!-- SEO插件会自动生成title、description、keywords等标签 -->
|
|
{% endblock %}
|
|
|
|
<link rel="profile" href="http://gmpg.org/xfn/11"/>
|
|
|
|
<!-- 资源提示和预加载优化 -->
|
|
<link rel="dns-prefetch" href="//cdn.mathjax.org"/>
|
|
<link rel="dns-prefetch" href="//cdn.jsdelivr.net"/>
|
|
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin/>
|
|
|
|
<!--[if lt IE 9]>
|
|
<script src="{% static 'blog/js/html5.js' %}" type="text/javascript"></script>
|
|
<![endif]-->
|
|
|
|
<!-- RSS和图标 -->
|
|
<link rel="alternate" type="application/rss+xml" title="{{ SITE_NAME }} » Feed" href="/feed"/>
|
|
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
|
|
<link rel="icon" href="/favicon.ico" type="image/x-icon"/>
|
|
<link rel="apple-touch-icon" href="/favicon.ico"/>
|
|
|
|
<!-- 本地字体加载 -->
|
|
<link rel="stylesheet" href="{% static 'blog/fonts/open-sans.css' %}">
|
|
|
|
|
|
<!-- 主题预加载脚本 - 防止闪烁 -->
|
|
<script>
|
|
(function() {
|
|
'use strict';
|
|
const storedTheme = localStorage.getItem('theme');
|
|
const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
const initialTheme = storedTheme || (systemDark ? 'dark' : 'light');
|
|
document.documentElement.setAttribute('data-theme', initialTheme);
|
|
})();
|
|
</script>
|
|
|
|
<link rel='stylesheet' id='twentytwelve-style-css' href='{% static 'blog/css/style.css' %}' type='text/css' media='all'/>
|
|
<link href="{% static 'blog/css/oauth_style.css' %}" rel="stylesheet">
|
|
<link href="{% static 'blog/css/maupassant.css' %}" rel="stylesheet">
|
|
<!-- 新增主题 CSS -->
|
|
<link href="{% static 'blog/css/theme.css' %}" rel="stylesheet">
|
|
|
|
{% comment %}<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>{% endcomment %}
|
|
|
|
<!--[if lt IE 9]>
|
|
<link rel='stylesheet' id='twentytwelve-ie-css' href='{% static 'blog/css/ie.css' %}' type='text/css' media='all' />
|
|
<![endif]-->
|
|
|
|
<link rel="stylesheet" href="{% static 'pygments/default.css' %}"/>
|
|
<link rel="stylesheet" href="{% static 'blog/css/nprogress.css' %}">
|
|
|
|
{% block compress_css %}
|
|
{% endblock %}
|
|
|
|
<!-- 插件CSS文件 - 集成到压缩系统 -->
|
|
{% plugin_compressed_css %}
|
|
|
|
|
|
{% if GLOBAL_HEADER %}
|
|
{{ GLOBAL_HEADER|safe }}
|
|
{% endif %}
|
|
|
|
<!-- 插件head资源 -->
|
|
{% plugin_head_resources %}
|
|
|
|
{% block extra_css %}{% endblock %}
|
|
</head>
|
|
|
|
<body class="home blog custom-font-enabled" data-theme="light">
|
|
<div id="page" class="hfeed site">
|
|
<header id="masthead" class="site-header" role="banner">
|
|
<hgroup>
|
|
<h1 class="site-title"><a href="/" title="{{ SITE_NAME }}" rel="home">{{ SITE_NAME }}</a></h1>
|
|
<h2 class="site-description">{{ SITE_DESCRIPTION }}</h2>
|
|
</hgroup>
|
|
|
|
<!-- 修改导航栏:集成主题切换和用户菜单 -->
|
|
<nav class="main-navigation" role="navigation">
|
|
<div class="nav-container">
|
|
<!-- 原有的导航菜单 -->
|
|
<div class="primary-nav">
|
|
{% include 'share_layout/nav.html' %}
|
|
</div>
|
|
|
|
<!-- 右侧功能区域 -->
|
|
<div class="nav-actions">
|
|
<!-- 主题切换按钮 -->
|
|
<div class="theme-toggle-container">
|
|
<button id="theme-toggle" class="theme-toggle-btn" title="切换主题" aria-label="切换主题">
|
|
<span class="theme-icon">🌙</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 用户菜单 - 修复版本 -->
|
|
<div class="user-menu">
|
|
{% if user.is_authenticated %}
|
|
<div class="user-dropdown">
|
|
<span class="username">
|
|
<i class="user-icon">👤</i>
|
|
{{ user.username }}
|
|
</span>
|
|
<div class="dropdown-content">
|
|
<!-- 使用安全的URL路径 -->
|
|
<a href="/accounts/profile/">
|
|
<i class="icon">⚙️</i>个人资料
|
|
</a>
|
|
<div class="dropdown-divider"></div>
|
|
<a href="/accounts/logout/">
|
|
<i class="icon">🚪</i>退出
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<a class="login-link" href="/accounts/login/">
|
|
<i class="icon">🔑</i>登录
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header><!-- #masthead -->
|
|
|
|
<div id="main" class="wrapper">
|
|
{% block content %}
|
|
{% endblock %}
|
|
|
|
{% block sidebar %}
|
|
{% endblock %}
|
|
</div><!-- #main .wrapper -->
|
|
|
|
{% include 'share_layout/footer.html' %}
|
|
</div><!-- #page -->
|
|
|
|
<!-- JavaScript资源 -->
|
|
{% compress js %}
|
|
<script src="{% static 'blog/js/jquery-3.6.0.min.js' %}"></script>
|
|
<script src="{% static 'blog/js/nprogress.js' %}"></script>
|
|
<script src="{% static 'blog/js/blog.js' %}"></script>
|
|
<script src="{% static 'blog/js/navigation.js' %}"></script>
|
|
<!-- 新增主题切换JS -->
|
|
<script src="{% static 'blog/js/theme-switcher.js' %}"></script>
|
|
|
|
{% block compress_js %}
|
|
{% endblock %}
|
|
|
|
<!-- 插件JS文件 - 集成到压缩系统 -->
|
|
{% plugin_compressed_js %}
|
|
{% endcompress %}
|
|
|
|
<!-- MathJax智能加载器 -->
|
|
<script src="{% static 'blog/js/mathjax-loader.js' %}" async defer></script>
|
|
|
|
{% block footer %}
|
|
{% endblock %}
|
|
|
|
<!-- 插件body资源 -->
|
|
{% plugin_body_resources %}
|
|
|
|
{% block extra_js %}{% endblock %}
|
|
</body>
|
|
</html> |