-
Notifications
You must be signed in to change notification settings - Fork 0
/
header.php
77 lines (77 loc) · 3.95 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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author" content="<?php $this->options->author() ?>">
<meta name="description" content="<?php $this->options->description() ?>">
<meta name="keywords" content="<?php $this->options->keywords() ?>">
<title>
<?php if($this->_currentPage>1) echo '第 '.$this->_currentPage.' 页 - '; ?><?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'date' => _t('在<span> %s </span>发布的文章'),
'author' => _t('%s 发布的文章')
), '', ' - '); ?><?php if ($this->is('post')) $this->category(',', false);?><?php if ($this->is('post')) echo ' - ';?><?php $this->options->title(); ?><?php if ($this->is('index')) echo ' - '; ?><?php if ($this->is('index')) $this->options->description() ?>
</title>
<link rel="icon" href="<?php $this->options->icoUrl() ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>">
<script src="<?php $this->options->themeUrl('script.js'); ?>"></script>
<?php $this->header("generator=&template=&pingback=&wlw=&xmlrpc=&rss1=&atom=&rss2=/feed"); ?>
<?php $this->options->addhead(); ?>
<?php $this->header(); ?>
</head>
<body>
<div class="wrapper">
<header>
<nav class="navbar">
<div class="container">
<div class="navbar-header header-logo">
<a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title() ?></a>
</div>
<div class="menu navbar-right">
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<a class="menu-item" href="<?php $this->options->posturl() ?>"><?php $this->options->postlisttittle() ?></a>
<?php while($pages->next()): ?>
<a <?php if($this->is('page', $pages->slug)): ?> <?php endif; ?>class="menu-item" href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
<?php endwhile; ?>
<input id="switch_default" type="checkbox" class="switch_default">
<label for="switch_default" class="toggleBtn"></label>
</div>
</div>
</nav>
<nav class="navbar-mobile" id="nav-mobile">
<div class="container">
<div class="navbar-header">
<div>
<a href="/"><?php $this->options->title() ?></a>
<a id="mobile-toggle-theme">· Light</a>
</div>
<div class="menu-toggle" onclick="mobileBtn()">☰ Menu</div>
</div>
<div class="menu" id="mobile-menu">
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<a class="menu-item" href="<?php $this->options->posturl() ?>"><?php $this->options->postlisttittle() ?></a>
<?php while($pages->next()): ?>
<a <?php if($this->is('page', $pages->slug)): ?> <?php endif; ?>class="menu-item" href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a>
<?php endwhile; ?>
</div>
</div>
</nav>
</header>
<script>
var mobileBtn = function f() {
var toggleMenu = document.getElementsByClassName("menu-toggle")[0];
var mobileMenu = document.getElementById("mobile-menu");
if(toggleMenu.classList.contains("active")){
toggleMenu.classList.remove("active")
mobileMenu.classList.remove("active")
}else{
toggleMenu.classList.add("active")
mobileMenu.classList.add("active")
}
}
</script>