fixed 分类样式优化
This commit is contained in:
1 parent
f6e7021fac
commit
929305d867
3 files changed
+168
-4
No files matched your search
@@ -13,6 +13,10 @@
|
||||
/* 中文标点符号 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@charset "UTF-8";:root {
|
||||
--background-color: #fafafa;
|
||||
--background-dark-color: #020617;
|
||||
@@ -60,6 +64,21 @@
|
||||
color: #e5e7eb;
|
||||
}
|
||||
|
||||
.meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
gap: 10px;
|
||||
margin-bottom: 20px;
|
||||
color: #999;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.meta-item {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .meta {
|
||||
color: #9ca3af;
|
||||
}
|
||||
@@ -2871,3 +2890,99 @@ img[atk-emoticon] {
|
||||
background-color: transparent;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
/* Category Page Styles */
|
||||
.category-container {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.category-header {
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px dashed var(--frame-color);
|
||||
}
|
||||
|
||||
.cat-title {
|
||||
font-size: 2.2rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 10px;
|
||||
color: var(--text-title-color);
|
||||
}
|
||||
|
||||
.cat-meta {
|
||||
color: var(--text-highlight-color);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.year-group {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.year-title {
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
color: var(--text-title-color);
|
||||
position: relative;
|
||||
padding-left: 15px;
|
||||
border-left: 4px solid var(--text-title-color);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .year-title {
|
||||
border-left-color: var(--text-title-dark-color);
|
||||
}
|
||||
|
||||
.year-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.year-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 15px;
|
||||
border-bottom: 1px solid var(--frame-color);
|
||||
transition: all 0.3s ease;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.year-item:hover {
|
||||
background-color: rgba(0, 0, 0, 0.03);
|
||||
padding-left: 25px;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .year-item:hover {
|
||||
background-color: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
.item-date {
|
||||
font-family: 'Monaco', 'Consolas', monospace;
|
||||
color: var(--text-highlight-color);
|
||||
margin-right: 20px;
|
||||
font-size: 0.9rem;
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
.item-link {
|
||||
color: var(--text-content-color);
|
||||
text-decoration: none;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 500;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
[data-theme="dark"] .item-link {
|
||||
color: var(--text-content-dark-color);
|
||||
}
|
||||
|
||||
.item-link:hover {
|
||||
color: var(--link-hover-color-light);
|
||||
}
|
||||
|
||||
[data-theme="dark"] .item-link:hover {
|
||||
color: var(--link-hover-color-dark);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,10 +5,15 @@
|
||||
<article style="margin-bottom: 3.5em;">
|
||||
<h1 class="post-title" itemprop="name headline" uk-scrollspy="cls: uk-animation-slide-top-small; delay: 200">{{ .Title }}</h1>
|
||||
<div class="meta" uk-scrollspy="cls: uk-animation-fade; delay: 300">
|
||||
作者: {{ .Params.author | default .Site.Params.author }} 浏览: <span id="busuanzi_value_page_uv"></span> 字数: {{ .WordCount }} 阅读: 约 {{ .ReadingTime }} 分钟 分类:
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ . }}">{{ . }}</a>
|
||||
{{ end }}
|
||||
<span class="meta-item">作者: {{ .Params.author | default .Site.Params.author }}</span>
|
||||
<span class="meta-item">浏览: <span id="busuanzi_value_page_uv"></span></span>
|
||||
<span class="meta-item">字数: {{ .WordCount }}</span>
|
||||
<span class="meta-item">阅读: 约 {{ .ReadingTime }} 分钟</span>
|
||||
<span class="meta-item">分类:
|
||||
{{ range .GetTerms "categories" }}
|
||||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="post-content" id="post-writing" itemprop="articleBody" uk-scrollspy="target: > h2,h3,h4,blockquote,img,table,figure; cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
{{ .Content }}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{{ define "main" }}
|
||||
<div id="pjax-container">
|
||||
<article class="category-container">
|
||||
<div class="category-header">
|
||||
<h1 class="cat-title">{{ .Title }}</h1>
|
||||
<div class="cat-meta">
|
||||
<span class="cat-count">共 {{ .Data.Pages | len }} 篇文章</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="category-content" uk-scrollspy="target: > .year-group; cls: uk-animation-slide-bottom-small; delay: 100">
|
||||
{{ $paginator := .Paginate .Pages }}
|
||||
{{ range $paginator.Pages.GroupByDate "2006" }}
|
||||
<div class="year-group">
|
||||
<h2 class="year-title">{{ .Key }}</h2>
|
||||
<ul class="year-list">
|
||||
{{ range .Pages }}
|
||||
<li class="year-item">
|
||||
<span class="item-date">{{ .Date.Format "01-02" }}</span>
|
||||
<a class="item-link" href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{{ if gt $paginator.TotalPages 1 }}
|
||||
<ul class="pagination">
|
||||
<li class="page-item page-previous">
|
||||
{{ if $paginator.HasPrev }}
|
||||
<a class="prev" title="上一页" href="{{ $paginator.Prev.URL }}">上一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
<li class="page-item page-next">
|
||||
{{ if $paginator.HasNext }}
|
||||
<a class="next" title="下一页" href="{{ $paginator.Next.URL }}">下一页</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in new issue
Block a user