-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathheader.php
58 lines (54 loc) · 3.23 KB
/
header.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html lang="zh" data-bs-theme=night>
<head>
<script>
let state = localStorage.getItem("data-bs-theme") || "default";
switch (state) {
case "dark":
document.documentElement.setAttribute("data-bs-theme", "dark");
break;
case "light":
document.documentElement.setAttribute("data-bs-theme", "light");
break;
default:
localStorage.setItem("data-bs-theme", "default");
state = window.matchMedia('(prefers-color-scheme: dark)').matches ? "dark" : "light";
document.documentElement.setAttribute("data-bs-theme", state);
break;
}
window.matchMedia("(prefers-color-scheme: dark)").addEventListener('change', event => {
if (localStorage.getItem("data-bs-theme") === "default") {
document.documentElement.setAttribute("data-bs-theme", event.matches ? "dark" : "light");
}
});
</script>
<meta charset="<?php $this->options->charset(); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="author" content="fordes123" />
<meta name="referrer" content="origin">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title><?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ' - '); ?><?php $this->options->title(); ?><?php if ($this->is('index')) : ?> - <?php $this->options->description(); ?><?php endif; ?></title>
<link rel="icon" href="<?php empty($this->options->favicon)? $this->options->themeUrl('/assets/image/favicon.ico') : $this->options->favicon(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php empty($this->options->favicon)? $this->options->themeUrl('/assets/image/favicon.ico') : $this->options->favicon(); ?>" type="image/x-icon" >
<link rel="apple-touch-icon" href="<?php $this->options->themeUrl('/assets/image/apple-touch-icon.png')?>" sizes="180x180" />
<link rel="stylesheet" href="//lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap/5.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php $this->options->themeUrl('./assets/css/style.min.css'); ?>">
<link rel="stylesheet" href="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/font-awesome/5.15.4/css/all.min.css">
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js" type="application/javascript"></script>
<!--<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"></script>-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- 通过自有函数输出HTML头部信息 -->
<?php $this->header(); ?>
</head>
<body class="home blog">
<div class="site-wrapper">