djhx-blogger 0.1.0__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of djhx-blogger might be problematic. Click here for more details.
- djhx_blogger/cli.py +26 -4
- djhx_blogger/gen.py +34 -13
- djhx_blogger/static/css/archive.css +49 -0
- djhx_blogger/static/css/article.css +147 -0
- djhx_blogger/static/css/basic.css +53 -0
- djhx_blogger/static/css/category.css +112 -0
- djhx_blogger/static/images/favicon.ico +0 -0
- djhx_blogger/static/template/archive.html +40 -0
- djhx_blogger/static/template/article.html +39 -0
- djhx_blogger/static/template/category.html +57 -0
- {djhx_blogger-0.1.0.dist-info → djhx_blogger-0.1.6.dist-info}/METADATA +3 -3
- djhx_blogger-0.1.6.dist-info/RECORD +20 -0
- djhx_blogger-0.1.6.dist-info/entry_points.txt +2 -0
- djhx_blogger-0.1.0.dist-info/RECORD +0 -11
- {djhx_blogger-0.1.0.dist-info → djhx_blogger-0.1.6.dist-info}/WHEEL +0 -0
- {djhx_blogger-0.1.0.dist-info → djhx_blogger-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {djhx_blogger-0.1.0.dist-info → djhx_blogger-0.1.6.dist-info}/top_level.txt +0 -0
djhx_blogger/cli.py
CHANGED
|
@@ -3,16 +3,24 @@ from pathlib import Path
|
|
|
3
3
|
import typer
|
|
4
4
|
|
|
5
5
|
from .deploy import compress_dir, deploy_blog
|
|
6
|
-
from .gen import generate_blog
|
|
7
|
-
from .log_config import log_init
|
|
6
|
+
from .gen import generate_blog, init_new_blog
|
|
7
|
+
from .log_config import log_init, app_logger
|
|
8
|
+
|
|
8
9
|
log_init()
|
|
9
10
|
|
|
11
|
+
logger = app_logger
|
|
12
|
+
|
|
10
13
|
app = typer.Typer()
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
@app.command()
|
|
14
17
|
def run(
|
|
15
|
-
origin: Path = typer.Argument(..., exists=True, readable=True, help="原始博客内容目录(必填)"),
|
|
18
|
+
# origin: Path = typer.Argument(..., exists=True, readable=True, help="原始博客内容目录(必填)"),
|
|
19
|
+
origin: Path = typer.Option(
|
|
20
|
+
None,
|
|
21
|
+
"--origin", '-o',
|
|
22
|
+
help='静态模块目录源地址',
|
|
23
|
+
),
|
|
16
24
|
target: Path = typer.Option(
|
|
17
25
|
Path.cwd(),
|
|
18
26
|
"--target", "-t",
|
|
@@ -33,6 +41,11 @@ def run(
|
|
|
33
41
|
"--deploy/--no-deploy",
|
|
34
42
|
help="是否将静态博客部署到远程服务器。",
|
|
35
43
|
),
|
|
44
|
+
new_blog: Path = typer.Option(
|
|
45
|
+
None,
|
|
46
|
+
"--new-blog", "-n",
|
|
47
|
+
help="生成一个简单的示例博客",
|
|
48
|
+
)
|
|
36
49
|
):
|
|
37
50
|
typer.echo(f"原始目录: {origin}")
|
|
38
51
|
typer.echo(f"输出目录: {target}")
|
|
@@ -40,7 +53,16 @@ def run(
|
|
|
40
53
|
typer.echo(f"目标服务器部署地址: {server_target}")
|
|
41
54
|
typer.echo(f"是否部署: {'是' if deploy else '否'}")
|
|
42
55
|
|
|
43
|
-
|
|
56
|
+
if new_blog:
|
|
57
|
+
logger.info(f'在 {new_blog} 下生成一个新的博客目录')
|
|
58
|
+
init_new_blog(str(new_blog))
|
|
59
|
+
return
|
|
60
|
+
|
|
61
|
+
if not origin:
|
|
62
|
+
logger.warning(f'需要指定 origin')
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
root_node = generate_blog(str(origin), str(target))
|
|
44
66
|
|
|
45
67
|
if deploy and server and server_target:
|
|
46
68
|
tar_path = compress_dir(root_node.destination_path)
|
djhx_blogger/gen.py
CHANGED
|
@@ -44,11 +44,12 @@ class Node:
|
|
|
44
44
|
return f'path={self.source_path}'
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
def walk_dir(dir_path_str: str,
|
|
47
|
+
def walk_dir(dir_path_str: str, destination_blog_dir_path_str: str, target_name: str='public') -> Node:
|
|
48
48
|
"""
|
|
49
49
|
遍历目录,构造树结构
|
|
50
50
|
:param dir_path_str: 存放博客 md 文件的目录的字符串
|
|
51
|
-
:param
|
|
51
|
+
:param destination_blog_dir_path_str: 生成博客目录的地址
|
|
52
|
+
:param target_name: 生成博客的目录名称
|
|
52
53
|
:return: 树结构的根节点
|
|
53
54
|
"""
|
|
54
55
|
|
|
@@ -58,7 +59,7 @@ def walk_dir(dir_path_str: str, destination_blog_dir_name: str) -> Node:
|
|
|
58
59
|
q.append(dir_path)
|
|
59
60
|
|
|
60
61
|
# 生成目录的根路径
|
|
61
|
-
destination_root_dir =
|
|
62
|
+
destination_root_dir = Path(destination_blog_dir_path_str).joinpath(target_name)
|
|
62
63
|
logger.info(f'源路经: {dir_path}, 目标路径: {destination_root_dir}')
|
|
63
64
|
|
|
64
65
|
root = None
|
|
@@ -259,7 +260,7 @@ def gen_blog_dir(root: Node):
|
|
|
259
260
|
logger.info(f'生成目标目录耗时: {end - start} ms')
|
|
260
261
|
|
|
261
262
|
|
|
262
|
-
def gen_blog_archive(blog_dir_str,
|
|
263
|
+
def gen_blog_archive(blog_dir_str: str, blog_target_dir_str: str, root: Node, target_name: str='public'):
|
|
263
264
|
"""
|
|
264
265
|
生成博客 archive 页面
|
|
265
266
|
按照年份分栏,日期排序,展示所有的博客文章
|
|
@@ -284,7 +285,7 @@ def gen_blog_archive(blog_dir_str, public_name, root: Node):
|
|
|
284
285
|
for article in articles_sorted:
|
|
285
286
|
article_name = article.source_path.name
|
|
286
287
|
full_path = article.destination_path / Path('index.html')
|
|
287
|
-
base_path =
|
|
288
|
+
base_path = Path(blog_target_dir_str) / Path(target_name)
|
|
288
289
|
url = full_path.relative_to(base_path)
|
|
289
290
|
|
|
290
291
|
article_datetime = article.metadata.get('date')
|
|
@@ -310,10 +311,9 @@ def gen_blog_archive(blog_dir_str, public_name, root: Node):
|
|
|
310
311
|
root_node_path.joinpath('archive.html').write_text(data=html, encoding='utf-8')
|
|
311
312
|
|
|
312
313
|
|
|
313
|
-
def cp_resource(
|
|
314
|
+
def cp_resource(blog_target_path_str: str):
|
|
314
315
|
"""将包内 static 资源复制到目标目录下的 public/"""
|
|
315
|
-
|
|
316
|
-
public_dir = dir_path.parent / "public"
|
|
316
|
+
public_dir = Path(blog_target_path_str) / "public"
|
|
317
317
|
|
|
318
318
|
# 1. 复制 css/
|
|
319
319
|
css_src = str(resources.files("djhx_blogger.static").joinpath("css"))
|
|
@@ -352,16 +352,37 @@ def parse_metadata(metadata):
|
|
|
352
352
|
return meta_dict
|
|
353
353
|
|
|
354
354
|
|
|
355
|
-
def generate_blog(blog_dir: str):
|
|
355
|
+
def generate_blog(blog_dir: str, blog_target: str):
|
|
356
356
|
start = time.time()
|
|
357
|
-
public_name = 'public'
|
|
358
357
|
|
|
359
358
|
logger.info("开始生成博客文件结构...")
|
|
360
|
-
root_node = walk_dir(blog_dir,
|
|
359
|
+
root_node = walk_dir(blog_dir, blog_target)
|
|
361
360
|
gen_blog_dir(root_node)
|
|
362
|
-
gen_blog_archive(blog_dir,
|
|
363
|
-
cp_resource(
|
|
361
|
+
gen_blog_archive(blog_dir, blog_target, root_node)
|
|
362
|
+
cp_resource(blog_target)
|
|
364
363
|
|
|
365
364
|
end = time.time()
|
|
366
365
|
logger.info(f'生成静态博客 {blog_dir}, 任务完成, 总耗时: {int((end-start)*1000)} ms')
|
|
367
366
|
return root_node
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
def init_new_blog(blog_dir: str):
|
|
370
|
+
blog_dir_path = Path(blog_dir) / "simple-blog" / "demo-article"
|
|
371
|
+
blog_dir_path.mkdir(parents=True, exist_ok=True)
|
|
372
|
+
with open(blog_dir_path / 'index.md', 'w', encoding='utf-8') as file:
|
|
373
|
+
file.write(f"""---
|
|
374
|
+
title: "Demo Post"
|
|
375
|
+
date: 1970-01-01T08:00:00+08:00
|
|
376
|
+
summary: "simple demo article"
|
|
377
|
+
---\n
|
|
378
|
+
|
|
379
|
+
# Hello world!\n
|
|
380
|
+
|
|
381
|
+
## title 1
|
|
382
|
+
|
|
383
|
+
### title 2
|
|
384
|
+
|
|
385
|
+
This is a simple demo...
|
|
386
|
+
"""
|
|
387
|
+
)
|
|
388
|
+
file.write('')
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
body {
|
|
2
|
+
background-color: #121212;
|
|
3
|
+
color: #e0e0e0;
|
|
4
|
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.archive-container {
|
|
10
|
+
max-width: 800px;
|
|
11
|
+
margin: 2rem auto;
|
|
12
|
+
padding: 0 1rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.archive-title {
|
|
16
|
+
font-size: 2rem;
|
|
17
|
+
margin-bottom: 2rem;
|
|
18
|
+
text-align: center;
|
|
19
|
+
border-bottom: 1px solid #333;
|
|
20
|
+
padding-bottom: 0.5rem;
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.archive-year {
|
|
25
|
+
margin-bottom: 2rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.archive-year h2 {
|
|
29
|
+
font-size: 1.5rem;
|
|
30
|
+
color: #bb86fc;
|
|
31
|
+
border-left: 4px solid #bb86fc;
|
|
32
|
+
padding-left: 0.5rem;
|
|
33
|
+
margin-bottom: 0.5rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.archive-year ul {
|
|
37
|
+
list-style: none;
|
|
38
|
+
padding-left: 1rem;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.archive-item {
|
|
42
|
+
margin: 0.3rem 0;
|
|
43
|
+
font-size: 1rem;
|
|
44
|
+
color: #cccccc;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.archive-item a {
|
|
48
|
+
color: wheat;
|
|
49
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
body {
|
|
2
|
+
background-color: #121212;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
article {
|
|
6
|
+
margin: 50px auto;
|
|
7
|
+
width: 50%;
|
|
8
|
+
background-color: #303030;
|
|
9
|
+
padding-left: 40px;
|
|
10
|
+
padding-right: 40px;
|
|
11
|
+
padding-bottom: 80px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
article h1 {
|
|
15
|
+
font-size: 3em;
|
|
16
|
+
text-align: center;
|
|
17
|
+
margin-top: 30px;
|
|
18
|
+
margin-bottom: 30px;
|
|
19
|
+
color: aliceblue;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
article h2 {
|
|
23
|
+
font-size: 2.2em;
|
|
24
|
+
margin-top: 30px;
|
|
25
|
+
margin-bottom: 20px;
|
|
26
|
+
color: cadetblue;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
article h3, article h4, article h5, article h6 {
|
|
30
|
+
font-size: 1.8em;
|
|
31
|
+
margin-top: 20px;
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
color: darkcyan;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
article p {
|
|
37
|
+
font-size: 1.2em;
|
|
38
|
+
line-height: 2.2em;
|
|
39
|
+
margin-bottom: 20px;
|
|
40
|
+
color: wheat;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
article img {
|
|
44
|
+
max-width: 100%; /* 限制图片宽度为容器宽度 */
|
|
45
|
+
height: auto; /* 保持图片比例 */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
code {
|
|
49
|
+
border: 1px solid #ddd; /* 添加边框 */
|
|
50
|
+
border-radius: 4px; /* 圆角边框 */
|
|
51
|
+
font-family: monospace; /* 使用等宽字体 */
|
|
52
|
+
font-size: 1.2em; /* 稍微缩小字体 */
|
|
53
|
+
margin-top: 20px;
|
|
54
|
+
margin-bottom: 20px;
|
|
55
|
+
color: white;
|
|
56
|
+
padding: 3px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
blockquote {
|
|
60
|
+
background-color: dimgrey;
|
|
61
|
+
margin: 1em 0; /* 设置上下间距 */
|
|
62
|
+
padding: 0.5em 1em; /* 内边距 */
|
|
63
|
+
border-left: 4px solid #0074d9; /* 左侧蓝色边框 */
|
|
64
|
+
color: #555; /* 设置文本颜色 */
|
|
65
|
+
font-style: italic; /* 倾斜字体 */
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
table {
|
|
69
|
+
width: 100%;
|
|
70
|
+
border-collapse: collapse;
|
|
71
|
+
margin: 1em 0;
|
|
72
|
+
background-color: #1e1e1e; /* 表格整体背景 */
|
|
73
|
+
color: #ccc; /* 默认文字颜色 */
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
table th, table td {
|
|
77
|
+
border: 1px solid #444; /* 深色边框 */
|
|
78
|
+
padding: 8px;
|
|
79
|
+
text-align: left;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
table th {
|
|
83
|
+
background-color: #2e2e2e; /* 表头背景色 */
|
|
84
|
+
color: #fff; /* 表头文字颜色 */
|
|
85
|
+
font-weight: bold;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
table tr:nth-child(even) {
|
|
89
|
+
background-color: #2a2a2a; /* 偶数行背景色 */
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
table tr:nth-child(odd) {
|
|
93
|
+
background-color: #242424; /* 奇数行背景色 */
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
table tr:hover {
|
|
97
|
+
background-color: #555522; /* 鼠标悬停高亮色 */
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
ul, ol {
|
|
101
|
+
margin: 1em 0; /* 上下外边距 */
|
|
102
|
+
padding-left: 2em; /* 左内边距(缩进) */
|
|
103
|
+
line-height: 1.6; /* 设置行高 */
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
ul {
|
|
107
|
+
list-style-type: disc; /* 使用圆点作为项目符号 */
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
ol {
|
|
111
|
+
list-style-type: decimal; /* 使用数字作为编号 */
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
ul li, ol li {
|
|
115
|
+
margin-bottom: 0.5em; /* 列表项的下间距 */
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
ul li::marker {
|
|
119
|
+
color: #0074d9; /* 修改圆点颜色 */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
ol li::marker {
|
|
123
|
+
color: #e74c3c; /* 修改数字颜色 */
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
li {
|
|
127
|
+
font-size: 1rem; /* 设置字体大小 */
|
|
128
|
+
color: aquamarine; /* 设置文字颜色 */
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
li:hover {
|
|
132
|
+
color: antiquewhite; /* 鼠标悬停时改变文字颜色 */
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
hr {
|
|
136
|
+
margin-top: 20px;
|
|
137
|
+
margin-bottom: 20px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.article-meta time, .article-meta p {
|
|
141
|
+
font-size: 0.9em;
|
|
142
|
+
color: aquamarine;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
a {
|
|
146
|
+
color: deeppink;
|
|
147
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
* {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
nav {
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: center;
|
|
11
|
+
padding: 10px 20px;
|
|
12
|
+
background-color: #333;
|
|
13
|
+
color: #fff;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
nav .brand {
|
|
17
|
+
font-size: 1.6em;
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
color: #4caf50;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
nav .nav-links a {
|
|
24
|
+
margin-left: 15px;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
color: #fff;
|
|
27
|
+
transition: color 0.3s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
nav .nav-links a:hover {
|
|
31
|
+
color: #4caf50;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.site-footer {
|
|
35
|
+
background: #141414; /* 深色背景 */
|
|
36
|
+
padding: 0.8rem;
|
|
37
|
+
margin-top: 4rem; /* 可以移除或调整,因为使用了 fixed 定位 */
|
|
38
|
+
border-top: 2px solid #444;
|
|
39
|
+
text-align: center;
|
|
40
|
+
position: fixed; /* 将 footer 固定定位 */
|
|
41
|
+
bottom: 0; /* 固定在底部 */
|
|
42
|
+
left: 0; /* 从左侧开始 */
|
|
43
|
+
width: 100%; /* 宽度撑满整个视口 */
|
|
44
|
+
z-index: 10; /* 确保不被其他元素遮挡,可以根据实际情况调整 */
|
|
45
|
+
color: wheat;
|
|
46
|
+
font-size: 0.7rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.site-footer a {
|
|
50
|
+
color: #ffd700; /* 高亮备案链接 */
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
body {
|
|
2
|
+
background-color: #202020;
|
|
3
|
+
|
|
4
|
+
min-height: 100vh;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
h1 {
|
|
11
|
+
text-align: center;
|
|
12
|
+
color: moccasin;
|
|
13
|
+
margin-top: 3%;
|
|
14
|
+
margin-bottom: 3%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
h2 {
|
|
18
|
+
text-align: center;
|
|
19
|
+
color: rgb(121, 149, 146);
|
|
20
|
+
margin-top: 3%;
|
|
21
|
+
margin-bottom: 3%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
hr {
|
|
25
|
+
border: 0;
|
|
26
|
+
border-top: 1px dashed #a2a9b6;
|
|
27
|
+
margin-top: 3%;
|
|
28
|
+
margin-bottom: 3%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* 分类容器优化 */
|
|
32
|
+
.category-container {
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
35
|
+
gap: 2rem;
|
|
36
|
+
padding: 2rem 1rem;
|
|
37
|
+
max-width: 1200px;
|
|
38
|
+
margin: 2rem auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.category {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: center;
|
|
45
|
+
background: linear-gradient(145deg, #2d2d2d, #383838);
|
|
46
|
+
border-radius: 16px;
|
|
47
|
+
padding: 2rem;
|
|
48
|
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
49
|
+
box-shadow: 0 8px 20px rgba(0,0,0,0.2);
|
|
50
|
+
backdrop-filter: blur(8px);
|
|
51
|
+
border: 1px solid rgba(255,255,255,0.05);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.category:hover {
|
|
55
|
+
transform: translateY(-8px);
|
|
56
|
+
box-shadow: 0 12px 30px rgba(76,175,80,0.15);
|
|
57
|
+
background: linear-gradient(145deg, #383838, #4d4d4d);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* 文章卡片优化 */
|
|
61
|
+
.article {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
background: linear-gradient(145deg, #2d2d2d, #383838);
|
|
66
|
+
border-radius: 16px;
|
|
67
|
+
padding: 2rem;
|
|
68
|
+
margin: 1.5rem 0;
|
|
69
|
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
70
|
+
box-shadow: 0 8px 20px rgba(0,0,0,0.2);
|
|
71
|
+
backdrop-filter: blur(8px);
|
|
72
|
+
border: 1px solid rgba(255,255,255,0.05);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.article:hover {
|
|
76
|
+
transform: translateY(-5px);
|
|
77
|
+
box-shadow: 0 10px 25px rgba(76,175,80,0.1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.article h2 {
|
|
81
|
+
color: rgb(255, 149, 146);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* 链接样式优化 */
|
|
85
|
+
.item-link {
|
|
86
|
+
margin-top: 1.5rem;
|
|
87
|
+
display: flex;
|
|
88
|
+
gap: 1rem;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
a {
|
|
93
|
+
font-size: 1.1em;
|
|
94
|
+
text-decoration: none;
|
|
95
|
+
color: #8b8ea3;
|
|
96
|
+
transition: all 0.3s ease;
|
|
97
|
+
padding: 0.5rem 1rem;
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
a:hover {
|
|
102
|
+
color: #4caf50;
|
|
103
|
+
background: rgba(76,175,80,0.1);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* 元数据样式 */
|
|
107
|
+
.article-metadata {
|
|
108
|
+
color: #b0b0b0;
|
|
109
|
+
font-size: 0.9rem;
|
|
110
|
+
margin-top: 1rem;
|
|
111
|
+
text-align: center;
|
|
112
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>归档</title>
|
|
6
|
+
<link rel="icon" type="image/x-icon" href="/blog/images/favicon.ico">
|
|
7
|
+
<link href="/blog/css/basic.css" rel="stylesheet">
|
|
8
|
+
<link href="/blog/css/archive.css" rel="stylesheet">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<nav>
|
|
12
|
+
<a href="/" class="brand">阿辉的小站</a>
|
|
13
|
+
<div class="nav-links">
|
|
14
|
+
<a href="/blog/index.html">blog</a>
|
|
15
|
+
<a href="/blog/archive.html">archive</a>
|
|
16
|
+
<a href="/blog/about/index.html">about</a>
|
|
17
|
+
<a href="/blog/hardware/index.html">hardware</a>
|
|
18
|
+
<a href="/blog/software/index.html">software</a>
|
|
19
|
+
<a href="/blog/cook/index.html">cook</a>
|
|
20
|
+
</div>
|
|
21
|
+
</nav>
|
|
22
|
+
|
|
23
|
+
<main class="archive-container">
|
|
24
|
+
<h1 class="archive-title">归档</h1>
|
|
25
|
+
{% for year, info in archives.items() %}
|
|
26
|
+
<section class="archive-year">
|
|
27
|
+
<h2>{{ year }} - 共计 {{ info.get('total') }} 篇</h2>
|
|
28
|
+
<ul>
|
|
29
|
+
{% for entry in info.get('articles') %}
|
|
30
|
+
<li class="archive-item">
|
|
31
|
+
<span class="date">{{ entry.date }}</span>:<a href="{{ entry.url }}">{{ entry.title }}</a>
|
|
32
|
+
</li>
|
|
33
|
+
{% endfor %}
|
|
34
|
+
</ul>
|
|
35
|
+
</section>
|
|
36
|
+
{% endfor %}
|
|
37
|
+
</main>
|
|
38
|
+
|
|
39
|
+
</body>
|
|
40
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title></title>
|
|
6
|
+
<link rel="icon" type="image/x-icon" href="/blog/images/favicon.ico">
|
|
7
|
+
<link href="/blog/css/basic.css" rel="stylesheet">
|
|
8
|
+
<link href="/blog/css/article.css" rel="stylesheet">
|
|
9
|
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github-dark.min.css"
|
|
10
|
+
rel="stylesheet"/>
|
|
11
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
|
12
|
+
<script>
|
|
13
|
+
hljs.highlightAll();
|
|
14
|
+
</script>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<nav>
|
|
18
|
+
<a href="/" class="brand">阿辉的小站</a>
|
|
19
|
+
<div class="nav-links">
|
|
20
|
+
<a href="/blog/index.html">blog</a>
|
|
21
|
+
<a href="/blog/archive.html">archive</a>
|
|
22
|
+
<a href="/blog/about/index.html">about</a>
|
|
23
|
+
<a href="/blog/hardware/index.html">hardware</a>
|
|
24
|
+
<a href="/blog/software/index.html">software</a>
|
|
25
|
+
<a href="/blog/cook/index.html">cook</a>
|
|
26
|
+
</div>
|
|
27
|
+
</nav>
|
|
28
|
+
|
|
29
|
+
<article></article>
|
|
30
|
+
<footer>
|
|
31
|
+
<p class="site-footer">
|
|
32
|
+
备案号:
|
|
33
|
+
<a href="https://beian.miit.gov.cn/" target="_blank">
|
|
34
|
+
浙ICP备19051268号
|
|
35
|
+
</a>
|
|
36
|
+
</p>
|
|
37
|
+
</footer>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>分类 | {{ category_name }}</title>
|
|
6
|
+
<link rel="icon" type="image/x-icon" href="/blog/images/favicon.ico">
|
|
7
|
+
<link href="/blog/css/basic.css" rel="stylesheet">
|
|
8
|
+
<link href="/blog/css/category.css" rel="stylesheet">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<nav>
|
|
12
|
+
<a href="/" class="brand">阿辉的小站</a>
|
|
13
|
+
<div class="nav-links">
|
|
14
|
+
<a href="/blog/index.html">blog</a>
|
|
15
|
+
<a href="/blog/archive.html">archive</a>
|
|
16
|
+
<a href="/blog/about/index.html">about</a>
|
|
17
|
+
<a href="/blog/hardware/index.html">hardware</a>
|
|
18
|
+
<a href="/blog/software/index.html">software</a>
|
|
19
|
+
<a href="/blog/cook/index.html">cook</a>
|
|
20
|
+
</div>
|
|
21
|
+
</nav>
|
|
22
|
+
|
|
23
|
+
<div class="category-container">
|
|
24
|
+
{% if not categories %}
|
|
25
|
+
<h1>暂无内容</h1>
|
|
26
|
+
{% endif %}
|
|
27
|
+
|
|
28
|
+
{% for item in categories %}
|
|
29
|
+
|
|
30
|
+
<div class="{{ 'article' if item['type'] == 'article' else 'category' }}">
|
|
31
|
+
<a href="{{ item['href'] }}">
|
|
32
|
+
<h2>
|
|
33
|
+
{{ item['name'] }}
|
|
34
|
+
</h2>
|
|
35
|
+
</a>
|
|
36
|
+
{% if item['metadata'] is not none %}
|
|
37
|
+
<div class="article-metadata">
|
|
38
|
+
<strong>Date:</strong> {{ item.metadata.date }}<br>
|
|
39
|
+
<strong>Summary:</strong> {{ item.metadata.summary }}
|
|
40
|
+
</div>
|
|
41
|
+
{% endif %}
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
{% endfor %}
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<footer>
|
|
48
|
+
<p class="site-footer">
|
|
49
|
+
备案号:
|
|
50
|
+
<a href="https://beian.miit.gov.cn/" target="_blank">
|
|
51
|
+
浙ICP备19051268号
|
|
52
|
+
</a>
|
|
53
|
+
</p>
|
|
54
|
+
</footer>
|
|
55
|
+
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: djhx-blogger
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
5
|
-
Requires-Python: >=3.
|
|
3
|
+
Version: 0.1.6
|
|
4
|
+
Summary: A simple static site generator, support only markdown file.
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Requires-Dist: beautifulsoup4>=4.14.2
|
|
8
8
|
Requires-Dist: fabric>=3.2.2
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
djhx_blogger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
djhx_blogger/__main__.py,sha256=MwMXMO3kuvG-luTG4lnLwjEnqnm20lI-amV9sETColo,61
|
|
3
|
+
djhx_blogger/cli.py,sha256=IT_hPolwqGsPbOLWwbQymfsHZtUyatgskXYue70UoFE,2013
|
|
4
|
+
djhx_blogger/deploy.py,sha256=tHJrOHaW8vQqN-YfpRLpjZOaUDXrWk_NVXnvPM014Hc,2056
|
|
5
|
+
djhx_blogger/gen.py,sha256=7XM_PQ2FXotFU4SRIQy7RAm-Pqc-iYHg8bu-AMMcVp0,13008
|
|
6
|
+
djhx_blogger/log_config.py,sha256=aEvShHNahBO52w5I6WU4U2yTMAO7qIezcH2K1vSnbVo,871
|
|
7
|
+
djhx_blogger/static/css/archive.css,sha256=Jkfl7HlQ-zsRDT4nFaR0WR7m3-AwCXsWVlLWBLdWVNM,855
|
|
8
|
+
djhx_blogger/static/css/article.css,sha256=lCuMUOia2E7_E_OG7c2Gc7JMr-RdoyASQQ2mB6J2qKo,3239
|
|
9
|
+
djhx_blogger/static/css/basic.css,sha256=gSKoyM_3GwoNGg3wScrVNl9ccnZwkw_ffnxODu_wbko,1152
|
|
10
|
+
djhx_blogger/static/css/category.css,sha256=DBjUWZiaZO8uzpl2iY3acEVYzigW2HM3dHRfh2zNjok,2351
|
|
11
|
+
djhx_blogger/static/images/favicon.ico,sha256=N0NH9yMTUzEZhGomQKeYohKP1MmL5CfmtsZi3jdlbvU,45497
|
|
12
|
+
djhx_blogger/static/template/archive.html,sha256=aTeyirij9reMl1WmDTmZVHF0yip3c8RoAam4tj6RIo8,1340
|
|
13
|
+
djhx_blogger/static/template/article.html,sha256=GgU1mZrfAd-T3Y4Z0bqOljdkGI89p-OsuCAU4IHrTwE,1246
|
|
14
|
+
djhx_blogger/static/template/category.html,sha256=KRjTJw-8G3bs_LrhfeEm7xYtBON5v0pLKTPwf_PD_Uo,1607
|
|
15
|
+
djhx_blogger-0.1.6.dist-info/licenses/LICENSE,sha256=Whbb1w0-YAwWeAth-B6_jXSPWx9Fum73B0R-Z_lzUjA,1085
|
|
16
|
+
djhx_blogger-0.1.6.dist-info/METADATA,sha256=h4R6Mmw8PdDWE5CZMhKkrNPpzuKn7uncp012Y0yh8WY,358
|
|
17
|
+
djhx_blogger-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
djhx_blogger-0.1.6.dist-info/entry_points.txt,sha256=3rA_ZPnqdFHrqaZ0ATmrrScDNSN-Jcs7efeyC4q2Do0,45
|
|
19
|
+
djhx_blogger-0.1.6.dist-info/top_level.txt,sha256=FZNu1SEldZAx_j_NmZoOxLha4G8-0KndmlFiPjPfJIk,13
|
|
20
|
+
djhx_blogger-0.1.6.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
djhx_blogger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
djhx_blogger/__main__.py,sha256=MwMXMO3kuvG-luTG4lnLwjEnqnm20lI-amV9sETColo,61
|
|
3
|
-
djhx_blogger/cli.py,sha256=v5VmlVI5sZEFca1C5VEmi7u9GMpvNBVd3NBLZSfKpks,1445
|
|
4
|
-
djhx_blogger/deploy.py,sha256=tHJrOHaW8vQqN-YfpRLpjZOaUDXrWk_NVXnvPM014Hc,2056
|
|
5
|
-
djhx_blogger/gen.py,sha256=AhShduRqJWYqdBPYVXnsSQ0v4Z9QWhtRI78olNIkHl4,12409
|
|
6
|
-
djhx_blogger/log_config.py,sha256=aEvShHNahBO52w5I6WU4U2yTMAO7qIezcH2K1vSnbVo,871
|
|
7
|
-
djhx_blogger-0.1.0.dist-info/licenses/LICENSE,sha256=Whbb1w0-YAwWeAth-B6_jXSPWx9Fum73B0R-Z_lzUjA,1085
|
|
8
|
-
djhx_blogger-0.1.0.dist-info/METADATA,sha256=j0rHWln9Zz5bKDABfig0ceqROGGAxjO1Y3nqgFVIpHk,325
|
|
9
|
-
djhx_blogger-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
djhx_blogger-0.1.0.dist-info/top_level.txt,sha256=FZNu1SEldZAx_j_NmZoOxLha4G8-0KndmlFiPjPfJIk,13
|
|
11
|
-
djhx_blogger-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|