-
Notifications
You must be signed in to change notification settings - Fork 55
/
page-archives.php
128 lines (128 loc) · 5.9 KB
/
page-archives.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
<?php
/**
* 归档页面
*
* @package custom
*/
if (!defined("__TYPECHO_ROOT_DIR__")) {
exit();
} ?>
<!DOCTYPE html>
<html lang="zh">
<?php $this->need("header.php"); ?>
<body class="jasmine-body">
<div class="jasmine-container grid grid-cols-12">
<?php $this->need("component/sidebar-left.php"); ?>
<div class="flex col-span-12 lg:col-span-8 flex-col border-x-2 border-stone-100 dark:border-neutral-600 lg:pt-0 lg:px-6 pb-10 px-3">
<?php $this->need("component/menu.php"); ?>
<div class="flex flex-col gap-y-12">
<div></div>
<div class="mx-1 flex flex-col">
<div></div>
<div class="flex flex-row" itemscope itemtype="https://schema.org/NewsArticle">
<div class="mr-3 flex flex-1 flex-col justify-center gap-y-3">
<h2 class="text-3xl font-semibold jasmine-primary-color" itemprop="headline">
标签
</h2>
</div>
</div>
</div>
<div class="flex px-3">
<?php
$this->widget("Widget_Metas_Tag_Cloud", "sort=mid&ignoreZeroCount=1&desc=0")->to($tags);
if ($tags->have()): ?>
<ul class="flex flex-row flex-wrap gap-y-6 gap-x-8">
<?php while ($tags->next()): ?>
<li class="nav-item">
<a class="nav-link dark:text-gray-400" href="<?php $tags->permalink(); ?>" rel="tag"
title="<?php $tags->name(); ?>">
<?php $tags->name(); ?>
<span
class="bg-black text-white rounded-lg px-[0.65em] py-[0.35em] text-[0.75em]"><?php $tags->count(); ?></span>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php endif;
?>
</div>
<div class="mx-1 flex flex-col">
<div></div>
<div class="flex flex-row" itemscope itemtype="https://schema.org/NewsArticle">
<div class="mr-3 flex flex-1 flex-col justify-center gap-y-3">
<h2 class="text-3xl font-semibold jasmine-primary-color" itemprop="headline">
分类
</h2>
</div>
</div>
</div>
<div class="flex px-3">
<?php $this->widget("Widget_Metas_Category_List")->to($categories); ?>
<?php if ($categories->have()): ?>
<ul class="flex flex-row flex-wrap gap-y-6 gap-x-8">
<?php while ($categories->next()): ?>
<li class="nav-item">
<a class="nav-link dark:text-gray-400" href="<?php $categories->permalink(); ?>" rel="tag"
title="<?php $categories->name(); ?>">
<?php $categories->name(); ?>
<span
class="bg-black text-white rounded-lg px-[0.65em] py-[0.35em] text-[0.75em]"><?php $categories->count(); ?></span>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
</div>
<div class="mx-1 flex flex-col">
<div></div>
<div class="flex flex-row" itemscope itemtype="https://schema.org/NewsArticle">
<div class="mr-3 flex flex-1 flex-col justify-center gap-y-3">
<h2 class="text-3xl font-semibold jasmine-primary-color" itemprop="headline">
文章
</h2>
</div>
</div>
</div>
<div class="flex px-3 flex-col">
<?php
$archives = getArchives($this);
$number = 0;
foreach ($archives as $year => $posts) {
$open = $number === 0 ? null : " closed";
echo '<h2 class="archive-year title text-2xl my-2 dark:text-neutral-300 jasmine-primary-color">' .
$year .
" 年</h2>";
echo '<ol id="flex flex-col archive-list-' .
$year .
'" class="archive-list jasmine-primary-color' .
$open .
'">';
foreach ($posts as $created => $post) {
if (isShuoShuoType($post["cid"])) {
continue;
}
echo '<li class="archive-item py-1"><a href="' .
$post["permalink"] .
'" class="no-line dark:text-gray-400">
<span class="archive-date">' .
date("m-d", $created) .
'</span> ·
' .
$post["title"] .
'
</a></li>';
}
echo "</ol>";
$number++;
}
?>
</div>
</div>
</div>
<div class="hidden lg:col-span-3 lg:block" id="sidebar-right">
<?php $this->need("component/sidebar.php"); ?>
</div>
</div>
<?php $this->need("footer.php"); ?>
</body>
</html>