归档列表样式

归档列表样式

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
<div class="post list">
<h1 class="posttitle">📝全部文章</h1>
<section id="articles-list">
<div class="container">
<form id="search" method="post" action="<?php $this->options->siteUrl(); ?>" role="search">
<input id="search-query" type="text" id="s" name="s" class="text" placeholder="搜索...">
</form>
<section>
<?php
$stat = Typecho_Widget::widget('Widget_Stat');
$this->widget('Widget_Contents_Post_Recent', 'pageSize=' . $stat->publishedPostsNum)->to($archives);
$year = 0;
$mon = 0;
$i = 0;
$j = 0;
$output = '<section>';
while ($archives->next()) {
$year_tmp = date('Y', $archives->created);
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= '<div class="post-row"><h2>' . date('Y', $archives->created) . '</h2></div>';
}
if ($this->options->PjaxOption && $archives->hidden) {
$output .= '<div class="post"><a href="' . $archives->permalink . '"><div class="post-row"><time>' . date('M j', $archives->created) . '</time><h3>'. $archives->title . '</h3></div></a></div>';
} else {
$output .= '<div class="post"><a href="' . $archives->permalink . '"><div class="post-row"><time>' . date('M j', $archives->created) . '</time><h3>'. $archives->title . '</h3></div></a></div>';
}
}
$output .= '</section>';
echo $output;
?>
</div>
</section>
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
#search-query {
width: 100%;
}
input.submit,input[type=password],#search-query{
padding:.8rem 1rem;
color:var(--input-color);
border:2px solid var(--border);
outline:0;
border-radius:.35rem;
font-size:1rem;
margin-left:auto;
margin-right:auto;
margin-bottom: 2rem;
margin-top: 2rem;
}
.list a {
align-items: center;
justify-content: stretch;
padding: 1rem 0;
}
.list a:hover {
display: flex;
align-items: center;
justify-content: stretch;
padding: 1rem 0;
background:#afa2a221;
}
.container{
max-width:825px;
padding:0 1.5rem;
margin-left:auto;
margin-right:auto
}
.post-row{
display:flex;
align-items:center;
width:100%
}
.post-row time{
display: block;
flex: 0 0 65px;
color: var(--light-font-color);
font-size: .85rem;
white-space: nowrap;
font-weight: 400;
}
.post-row h2{
border-bottom-width: 4px;
border-bottom: 4px solidvar(--light-background);
}
.post-row h3{
flex:1
}

归档列表样式
http://yoursite.com/2022/10/01/typecho/archives2/
作者
雨停之後
发布于
2022年10月1日
许可协议