forked from MoXiaoXi233/PureSuck-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar.php
83 lines (78 loc) · 3.34 KB
/
sidebar.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
<div class="right-sidebar" id="right-sidebar">
<!-- 搜索功能 -->
<?php if ($this->options->showSearch == '1'): ?>
<div class="search-section">
<header class="section-header">
<span class="icon-search"></span>
<span class="title">搜索</span>
</header>
<section class="section-body">
<form method="get" action="<?php $this->options->siteUrl(); ?>" class="search-container">
<input type="text" name="s" class="search-input" placeholder="输入关键字搜索">
<button type="submit" class="search-button" aria-label="搜索">
<span class="icon-search"></span>
</button>
</form>
</section>
</div>
<?php endif; ?>
<!-- 分类模块 -->
<?php if ($this->options->showCategory == '1'): ?>
<div class="category-section">
<header class="section-header">
<span class="icon-emo-wink"></span>
<span class="title">分类</span>
</header>
<section class="section-body">
<div class="category-cloud">
<?php $this->widget('Widget_Metas_Category_List')->to($categories); ?>
<?php if ($categories->have()): ?>
<?php while ($categories->next()): ?>
<a href="<?php $categories->permalink(); ?>" class="category"><?php $categories->name(); ?></a>
<?php endwhile; ?>
<?php else: ?>
<p><?php _e('没有任何分类'); ?></p>
<?php endif; ?>
</div>
</section>
</div>
<?php endif; ?>
<!-- 标签模块 -->
<?php if ($this->options->showTag == '1'): ?>
<div class="tag-section">
<header class="section-header">
<span class="icon-hashtag"></span>
<span class="title">标签</span>
</header>
<section class="section-body">
<div class="tag-cloud">
<?php $this->widget('Widget_Metas_Tag_Cloud')->to($tags); ?>
<?php if ($tags->have()): ?>
<?php while ($tags->next()): ?>
<a href="<?php $tags->permalink(); ?>" class="tag"><?php $tags->name(); ?></a>
<?php endwhile; ?>
<?php else: ?>
<p><?php _e('没有任何标签'); ?></p>
<?php endif; ?>
</div>
</section>
</div>
<?php endif; ?>
<!-- TOC -->
<?php if ($this->options->showTOC == '1' && ($this->is('post') || $this->is('page') || $this->is('archives'))): ?>
<div class="toc-section" id="toc-section" style="display: none;">
<header class="section-header">
<span class="icon-article"></span>
<span class="title">文章目录</span>
</header>
<section class="section-body">
<div class="toc"></div>
</section>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
initializeStickyTOC();
});
</script>
<?php endif; ?>
</div>