From 1ccca963f20a0f55f3bdc1f0c8fb09e62572f26b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=8F=E8=B5=B5=E5=90=8C=E5=AD=A6?=
<94612053+imzql@users.noreply.github.com>
Date: Thu, 11 Jul 2024 16:41:31 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=B7=A5=E6=89=80=E6=9C=89=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/archives/index.html | 108 +++++++++++++++++----
public/css/light.css | 29 +++++-
themes/Ying/hugo.toml | 5 +
themes/Ying/layouts/_default/archives.html | 42 ++++++++
themes/Ying/static/css/light.css | 29 +++++-
5 files changed, 192 insertions(+), 21 deletions(-)
create mode 100644 themes/Ying/layouts/_default/archives.html
diff --git a/public/archives/index.html b/public/archives/index.html
index 41dbdefa..c5dfb6ef 100644
--- a/public/archives/index.html
+++ b/public/archives/index.html
@@ -62,25 +62,99 @@
-
- 归档
-
- 作者: 小赵同学 浏览: 字数: 0 分类:
-
-
-
-
-
-
-
diff --git a/public/css/light.css b/public/css/light.css
index 9e310979..92fc0e7a 100644
--- a/public/css/light.css
+++ b/public/css/light.css
@@ -1422,12 +1422,36 @@ font-size: 14px;
flex-wrap: wrap
}
-.link-list a {
+/* .link-list a {
display: block;
width: 47%;
padding: 8px
+} */
+
+/* 基本样式 */
+.link-list a {
+ display: block;
+ width: 47%;
+ padding: 8px;
+ box-sizing: border-box; /* 包括padding和border在内计算宽度 */
}
+/* 移动端样式调整 */
+@media (max-width: 768px) {
+ .link-list a {
+ width: 100%; /* 在小屏幕上占据整个宽度 */
+ padding: 12px; /* 在小屏幕上增加内边距 */
+ }
+}
+
+/* 更小屏幕的样式调整 */
+@media (max-width: 480px) {
+ .link-list a {
+ padding: 15px; /* 在更小的屏幕上增加内边距 */
+ }
+}
+
+
.link-list .inner {
display: flex;
flex-direction: column;
@@ -1436,7 +1460,8 @@ font-size: 14px;
border: 1px solid #eceff2;
padding: 0 23px;
height: 100px;
- transition: color,background .2s ease-in-out
+ transition: color,background .2s ease-in-out;
+ box-shadow: rgba(0, 0, 0, 0.08) 0px 4px 12px;
}
.link-list .inner:hover {
diff --git a/themes/Ying/hugo.toml b/themes/Ying/hugo.toml
index bc3dbc4f..b66992af 100644
--- a/themes/Ying/hugo.toml
+++ b/themes/Ying/hugo.toml
@@ -48,6 +48,11 @@ name = "links"
weight = 20
url = "/links"
+[[menu.main]]
+name = "archives"
+weight = 20
+url = "/archives"
+
# 模块配置
[module]
# Hugo 版本要求
diff --git a/themes/Ying/layouts/_default/archives.html b/themes/Ying/layouts/_default/archives.html
new file mode 100644
index 00000000..471af1ae
--- /dev/null
+++ b/themes/Ying/layouts/_default/archives.html
@@ -0,0 +1,42 @@
+{{ define "main" }}
+
+ {{/*
{{ .Title }}
*/}}
+
+ {{ $currentYear := 0 }}
+ {{ $currentMonth := 0 }}
+ {{ range .Site.RegularPages }}
+ {{ if eq .Type "post" }}
+ {{ $year := .Date.Year }}
+ {{ $month := .Date.Month }}
+ {{ if ne $year $currentYear }}
+ {{ with $currentYear }} {{ if ne $currentYear 0 }}
{{ end }} {{ end }}
+
+ {{ $year }}
+
+ {{ $currentYear = $year }}
+ {{ $currentMonth = 0 }}
+ {{ end }}
+ {{ if ne $month $currentMonth }}
+ {{ with $currentMonth }} {{ if ne $currentMonth 0 }}
+
{{ end }} {{ end }}
+
+ {{ $month | printf "%02d" }}月
+
+
+ {{ $currentMonth = $month }}
+ {{ end }}
+
+ {{ .Date.Format "01/02" }}
+ {{ .Title }}
+
+ {{ end }}
+ {{ end }}
+ {{ if ne $currentMonth 0 }}
+
{{ end }}
+
+
+{{ end }}
\ No newline at end of file
diff --git a/themes/Ying/static/css/light.css b/themes/Ying/static/css/light.css
index 9e310979..92fc0e7a 100644
--- a/themes/Ying/static/css/light.css
+++ b/themes/Ying/static/css/light.css
@@ -1422,12 +1422,36 @@ font-size: 14px;
flex-wrap: wrap
}
-.link-list a {
+/* .link-list a {
display: block;
width: 47%;
padding: 8px
+} */
+
+/* 基本样式 */
+.link-list a {
+ display: block;
+ width: 47%;
+ padding: 8px;
+ box-sizing: border-box; /* 包括padding和border在内计算宽度 */
}
+/* 移动端样式调整 */
+@media (max-width: 768px) {
+ .link-list a {
+ width: 100%; /* 在小屏幕上占据整个宽度 */
+ padding: 12px; /* 在小屏幕上增加内边距 */
+ }
+}
+
+/* 更小屏幕的样式调整 */
+@media (max-width: 480px) {
+ .link-list a {
+ padding: 15px; /* 在更小的屏幕上增加内边距 */
+ }
+}
+
+
.link-list .inner {
display: flex;
flex-direction: column;
@@ -1436,7 +1460,8 @@ font-size: 14px;
border: 1px solid #eceff2;
padding: 0 23px;
height: 100px;
- transition: color,background .2s ease-in-out
+ transition: color,background .2s ease-in-out;
+ box-shadow: rgba(0, 0, 0, 0.08) 0px 4px 12px;
}
.link-list .inner:hover {
+ 07月 +
+