Repository navigation
Expand file tree
/
Copy pathheader.php
More file actions
100 lines (97 loc) · 6.09 KB
/
Copy pathheader.php
File metadata and controls
100 lines (97 loc) · 6.09 KB
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
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="<?php $this->options->charset(); ?>">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
<meta name="color-scheme" content="light dark">
<title><?php echo htmlspecialchars(timellow_document_title($this), ENT_QUOTES, 'UTF-8'); ?></title>
<?php if (timellow_option('faviconUrl', '') !== ''): ?>
<link rel="icon" href="<?php echo htmlspecialchars((string) timellow_option('faviconUrl', ''), ENT_QUOTES, 'UTF-8'); ?>">
<link rel="shortcut icon" href="<?php echo htmlspecialchars((string) timellow_option('faviconUrl', ''), ENT_QUOTES, 'UTF-8'); ?>">
<link rel="apple-touch-icon" href="<?php echo htmlspecialchars((string) timellow_option('faviconUrl', ''), ENT_QUOTES, 'UTF-8'); ?>">
<?php endif; ?>
<script>
(function () {
var key = 'timellow-theme';
var theme = 'light';
try {
var stored = window.localStorage.getItem(key);
if (stored === 'light' || stored === 'dark') {
theme = stored;
} else if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark';
}
} catch (e) {}
document.documentElement.setAttribute('data-theme', theme);
})();
</script>
<?php $timellowFontPreloadUrl = timellow_article_font_preload_url(); ?>
<?php if ($timellowFontPreloadUrl !== ''): ?>
<link rel="preload" href="<?php echo timellow_escape($timellowFontPreloadUrl); ?>" as="font" crossorigin>
<?php endif; ?>
<link rel="stylesheet" href="<?php echo timellow_escape(timellow_asset_url('style.css')); ?>">
<style>
<?php echo timellow_article_font_style_block(); ?>
</style>
<?php $this->header($this->is('post') || $this->is('page') ? 'commentReply=1' : ''); ?>
<?php if (timellow_option('analyticsCode', '') !== ''): ?>
<?php echo trim((string) timellow_option('analyticsCode', '')); ?>
<?php endif; ?>
</head>
<?php $timellowHasSidebar = timellow_has_sidebar($this); ?>
<body class="timellow-<?php echo htmlspecialchars((string) $this->archiveType, ENT_QUOTES, 'UTF-8'); ?><?php echo $timellowHasSidebar ? ' timellow-has-sidebar' : ' timellow-no-sidebar'; ?>">
<div class="site-shell">
<div class="container">
<header class="site-header">
<div class="header-inner">
<div class="brand">
<a class="brand-link" href="<?php $this->options->siteUrl(); ?>" aria-label="<?php echo htmlspecialchars(timellow_site_title(), ENT_QUOTES, 'UTF-8'); ?>">
<span class="brand-copy">
<span class="brand-title"><?php echo htmlspecialchars(timellow_site_title(), ENT_QUOTES, 'UTF-8'); ?></span>
<span class="brand-description"><?php echo htmlspecialchars(timellow_site_subtitle(), ENT_QUOTES, 'UTF-8'); ?></span>
</span>
</a>
</div>
<div class="header-actions">
<nav class="site-nav" aria-label="主导航">
<a<?php if ($this->is('index')): ?> class="is-current"<?php endif; ?> href="<?php $this->options->siteUrl(); ?>"><?php _e('首页'); ?></a>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<a<?php if ($this->is('page', $pages->slug)): ?> class="is-current"<?php endif; ?>
href="<?php $pages->permalink(); ?>"
title="<?php echo timellow_escape_title($pages->title); ?>"><?php echo timellow_escape_title($pages->title); ?></a>
<?php endwhile; ?>
</nav>
<div class="header-tools">
<button type="button" class="search-toggle" data-search-toggle aria-expanded="false" aria-controls="site-search-panel">
<span class="screen-reader-text"><?php _e('打开搜索'); ?></span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="11" cy="11" r="7"></circle>
<path d="m20 20-3.8-3.8"></path>
</svg>
</button>
<button type="button" class="theme-toggle" data-theme-toggle aria-pressed="false">
<span class="screen-reader-text" data-theme-label><?php _e('切换深色模式'); ?></span>
<svg viewBox="0 0 24 24" aria-hidden="true">
<circle class="theme-icon-light" cx="12" cy="12" r="8.5"></circle>
<path class="theme-icon-dark" d="M12 3.5a8.5 8.5 0 0 0 0 17z"></path>
<circle class="theme-icon-ring" cx="12" cy="12" r="8.5"></circle>
</svg>
</button>
</div>
</div>
</div>
<div class="search-panel" id="site-search-panel" data-search-panel hidden>
<form class="search-form" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
<label for="timellow-search" class="screen-reader-text"><?php _e('搜索关键字'); ?></label>
<input id="timellow-search" type="search" name="s" placeholder="<?php _e('搜索文章、页面或关键词'); ?>">
<button type="submit"><?php _e('搜索'); ?></button>
</form>
</div>
</header>
<div class="site-layout<?php echo $timellowHasSidebar ? ' has-sidebar' : ''; ?>">
<?php if ($timellowHasSidebar): ?>
<?php $this->need('sidebar.php'); ?>
<?php endif; ?>