forked from liaocp666/Jasmine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
102 lines (101 loc) · 3.97 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<head>
<meta charset="UTF-8"/>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<?php if ($this->is("index")): ?>
<meta property="og:type" content="blog"/>
<meta property="og:url" content="<?php $this->options->siteUrl(); ?>"/>
<meta property="og:title" content="<?php $this->options->title(); ?>"/>
<meta property="og:author" content="<?php $this->author->name(); ?>"/>
<meta name="keywords" content="<?php $this->keywords(); ?>">
<meta name="description" content="<?php $this->options->description(); ?>">
<?php endif; ?>
<?php if ($this->is("post") || $this->is("page") || $this->is("attachment")): ?>
<meta property="og:url" content="<?php $this->permalink(); ?>"/>
<meta property="og:title" content="<?php $this->title(); ?> - <?php $this->options->title(); ?>"/>
<meta property="og:author" content="<?php $this->author(); ?>"/>
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="<?php $this->date("c"); ?>"/>
<meta property="article:published_first"
content="<?php $this->options->title(); ?>, <?php $this->permalink(); ?>"/>
<meta name="keywords" content="<?php
$k = $this->fields->keyword;
if (empty($k)) {
echo $this->keywords();
} else {
echo $k;
}
?>">
<meta name="description" content="<?php
$d = $this->fields->description;
if (empty($d) || !$this->is("single")) {
if ($this->getDescription()) {
echo $this->getDescription();
}
} else {
echo $d;
}
?>"/>
<?php endif; ?>
<title><?php
$this->archiveTitle(
[
"category" => _t("分类 %s 下的文章"),
"search" => _t("包含关键字 %s 的文章"),
"tag" => _t("标签 %s 下的文章"),
"author" => _t("%s 发布的文章"),
],
"",
" - "
);
$this->options->title();
?></title>
<?php $this->header("description=&generator=&pingback=&template=&xmlrpc=&wlw=&commentReply=&keywords="); ?>
<link rel="dns-prefetch" href="https://npm.elemecdn.com" />
<style>
<?php if (getOptions()->themeColor == "1"): ?>
:root {
--primary-bg: #a6c4c2;
--link-color: #77b3af;
--link-hover-color: #77b3af;
}
<?php elseif (getOptions()->themeColor == "2"): ?>
:root{
--primary-bg: #feae51;
--link-color: #f08409;
--link-hover-color: #f08409;
}
<?php elseif (getOptions()->themeColor == "3"): ?>
:root{
--primary-bg: #a2c6e1;
--link-color: #668aa5;
--link-hover-color: #668aa5;
}
<?php elseif (getOptions()->themeColor == "4"): ?>
:root{
--primary-bg: rgb(239 68 68);
--link-color: rgb(239 68 68);
--link-hover-color: rgb(239 68 68);
}
<?php else: ?>
:root {
--primary-bg: #000;
--link-hover-color: #000;
}
<?php endif; ?>
</style>
<link type="text/css" rel="stylesheet" href="<?php $this->options->themeUrl(
"assets/dist/style.css?v=" . getThemeVersion()
); ?>"/>
<link rel="shoucut icon" href="<?php echo getOptionValueOrDefault("icon", $this->options->siteUrl . 'favicon.ico') ?>">
<script async src="https://cdn.staticfile.org/smoothscroll/1.4.10/SmoothScroll.min.js"></script>
<script async src="https://npm.elemecdn.com/[email protected]/dist/iconify-icon.min.js"></script>
<script src="<?php $this->options->themeUrl("/assets/dist/jasmine.iife.js?v=" . getThemeVersion()); ?>"></script>
<style>
<?php $this->options->customStyle(); ?>
</style>
</head>