This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
header.php
147 lines (135 loc) · 6.08 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;
if ($this->is('single')) {
if ($this->options->toc) {
$this->content = createCatalog($this->content);
}
$this->content = preg_replace('/<img(.*?)src=[\'"]([^\'"]+)[\'"](.*?)>/i',"<noscript>\$0</noscript><img\$1data-src=\"\$2\" \$3>",$this->content);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?php $this->archiveTitle(array(
'category' => _t('%s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 的文章')
), '', ' - '); ?><?php
$this->options->title();
if ($this->is('index') && $this->options->subtitle != '') echo " - {$this->options->subtitle}";
?></title>
<!-- Favicon -->
<link href="<?php
if ($this->options->logoUrl == '') {
$this->options->themeUrl("images/logo.png");
} else {
$this->options->logoUrl();
}
?>" rel="icon" type="image/png">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
<!-- FontAwesome -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css" rel="stylesheet">
<!-- Main CSS -->
<link type="text/css" href="<?php $this->options->themeUrl("assets/css/main.min.css"); ?>" rel="stylesheet">
<!-- KaTeX CSS -->
<?php if ($this->options->katex): ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
<?php endif; ?>
<!-- PrismJS CSS -->
<?php if ($this->options->prismjs): ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/<?php $this->options->prismTheme(); ?>.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/plugins/toolbar/prism-toolbar.css" />
<?php if ($this->options->prismLine): ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/plugins/line-numbers/prism-line-numbers.css" />
<?php endif; ?>
<?php endif; ?>
<!-- Viewer CSS -->
<?php if ($this->options->viewerEnable): ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/viewerjs/dist/viewer.min.css" />
<?php endif; ?>
<!-- Jquery -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<!-- Custom CSS -->
<?php if ($this->options->customCss): ?>
<style type="text/css"><?php $this->options->customCss(); ?></style>
<?php endif; ?>
<!-- Viewer.js Plugin -->
<?php if ($this->options->viewerEnable): ?>
<script src="https://cdn.jsdelivr.net/npm/viewerjs/dist/viewer.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/fengyuanchen/jquery-viewer@master/dist/jquery-viewer.min.js"></script>
<?php endif; ?>
<!-- MD5 Js -->
<script src="https://cdn.jsdelivr.net/gh/blueimp/JavaScript-MD5/js/md5.min.js"></script>
<!-- LazyLoad Js -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/dkern/jquery.lazy/jquery.lazy.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/dkern/jquery.lazy/jquery.lazy.plugins.min.js"></script>
<!-- Typecho header -->
<?php if($this->options->Pjax=="1"): ?>
<?php $this->header('commentReply=&antiSpam='); ?>
<?php else: ?>
<?php $this->header('commentReply='); ?>
<?php endif; ?>
</head>
<body>
<header class="header-global">
<nav id="navbar-main" class="navbar navbar-main navbar-expand-lg navbar-transparent navbar-light headroom">
<div class="container">
<a class="navbar-brand" href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title() ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-default" aria-controls="navbar-default" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbar-default">
<div class="navbar-collapse-header">
<div class="row">
<div class="col-6 collapse-brand">
<a href="<?php $this->options->siteUrl(); ?>"><h5><?php $this->options->title() ?></h5></a>
</div>
<div class="col-6 collapse-close">
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-default" aria-controls="navbar-default" aria-expanded="false" aria-label="Toggle navigation">
<span></span>
<span></span>
</button>
</div>
</div>
</div>
<ul class="navbar-nav ml-lg-auto align-items-lg-center">
<li class="nav-item">
<a class="nav-link" href="<?php $this->options->siteUrl(); ?>">首页</a>
</li>
<li class="nav-item">
<?php
$this->widget('Widget_Contents_Page_List')->to($pages);
while($pages->next()):
?>
<li class="nav-item">
<a class="nav-link" href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
</li>
<?php endwhile; ?>
<?php
$links = explode("$@!$", $this->options->headerLinks);
foreach ($links as $key => $value) {
$link = explode("$$", $value)
?>
<li class="nav-item">
<a class="nav-link" target="_blank" href="<?php echo $link[1]; ?>" title="<?php echo $link[0]; ?>"><?php echo $link[0]; ?></a>
</li>
<?php }; ?>
<li class="navbar_search_container">
<form method="post" action="" id="search">
<div class="input-group input-group-alternative">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-search"></i></span>
</div>
<input type="text" name="s" class="form-control" placeholder="搜点什么……" type="text" autocomplete="off">
</div>
</form>
</li>
</ul>
</div>
</div>
</nav>
</header>
<?php if($this->options->Pjax) _e('<div id="pjax-container">'); ?>