djhx-blogger 0.1.4__tar.gz → 0.1.7__tar.gz
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-0.1.7/PKG-INFO +36 -0
- djhx_blogger-0.1.7/README.md +22 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/pyproject.toml +3 -2
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/cli.py +25 -3
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/gen.py +22 -0
- djhx_blogger-0.1.7/src/djhx_blogger.egg-info/PKG-INFO +36 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger.egg-info/SOURCES.txt +1 -0
- djhx_blogger-0.1.4/PKG-INFO +0 -12
- djhx_blogger-0.1.4/src/djhx_blogger.egg-info/PKG-INFO +0 -12
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/LICENSE +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/setup.cfg +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/__init__.py +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/__main__.py +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/deploy.py +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/log_config.py +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/css/archive.css +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/css/article.css +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/css/basic.css +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/css/category.css +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/images/favicon.ico +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/template/archive.html +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/template/article.html +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger/static/template/category.html +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger.egg-info/dependency_links.txt +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger.egg-info/entry_points.txt +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger.egg-info/requires.txt +0 -0
- {djhx_blogger-0.1.4 → djhx_blogger-0.1.7}/src/djhx_blogger.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: djhx-blogger
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: A simple static site generator, support only markdown file.
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: beautifulsoup4>=4.14.2
|
|
9
|
+
Requires-Dist: fabric>=3.2.2
|
|
10
|
+
Requires-Dist: jinja2>=3.1.6
|
|
11
|
+
Requires-Dist: markdown>=3.9
|
|
12
|
+
Requires-Dist: typer>=0.20.0
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# djhx-blogger
|
|
16
|
+
|
|
17
|
+
一个个人使用的博客生成器。
|
|
18
|
+
|
|
19
|
+
## 命令
|
|
20
|
+
|
|
21
|
+
查看帮助
|
|
22
|
+
```shell
|
|
23
|
+
blg --help
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
生成一个示例博客目录
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
blg -n "C:\Users\ABC\Desktop\"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
生成静态页面
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
blg blg -o "C:\Users\ABC\Desktop\simple-blog\"
|
|
36
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# djhx-blogger
|
|
2
|
+
|
|
3
|
+
一个个人使用的博客生成器。
|
|
4
|
+
|
|
5
|
+
## 命令
|
|
6
|
+
|
|
7
|
+
查看帮助
|
|
8
|
+
```shell
|
|
9
|
+
blg --help
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
生成一个示例博客目录
|
|
13
|
+
|
|
14
|
+
```shell
|
|
15
|
+
blg -n "C:\Users\ABC\Desktop\"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
生成静态页面
|
|
19
|
+
|
|
20
|
+
```shell
|
|
21
|
+
blg blg -o "C:\Users\ABC\Desktop\simple-blog\"
|
|
22
|
+
```
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "djhx-blogger"
|
|
3
|
-
version = "0.1.
|
|
4
|
-
description = "
|
|
3
|
+
version = "0.1.7"
|
|
4
|
+
description = "A simple static site generator, support only markdown file."
|
|
5
|
+
readme = "README.md"
|
|
5
6
|
requires-python = ">=3.9"
|
|
6
7
|
dependencies = [
|
|
7
8
|
"beautifulsoup4>=4.14.2",
|
|
@@ -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,6 +53,15 @@ def run(
|
|
|
40
53
|
typer.echo(f"目标服务器部署地址: {server_target}")
|
|
41
54
|
typer.echo(f"是否部署: {'是' if deploy else '否'}")
|
|
42
55
|
|
|
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
|
+
|
|
43
65
|
root_node = generate_blog(str(origin), str(target))
|
|
44
66
|
|
|
45
67
|
if deploy and server and server_target:
|
|
@@ -364,3 +364,25 @@ def generate_blog(blog_dir: str, blog_target: str):
|
|
|
364
364
|
end = time.time()
|
|
365
365
|
logger.info(f'生成静态博客 {blog_dir}, 任务完成, 总耗时: {int((end-start)*1000)} ms')
|
|
366
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,36 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: djhx-blogger
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: A simple static site generator, support only markdown file.
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: beautifulsoup4>=4.14.2
|
|
9
|
+
Requires-Dist: fabric>=3.2.2
|
|
10
|
+
Requires-Dist: jinja2>=3.1.6
|
|
11
|
+
Requires-Dist: markdown>=3.9
|
|
12
|
+
Requires-Dist: typer>=0.20.0
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# djhx-blogger
|
|
16
|
+
|
|
17
|
+
一个个人使用的博客生成器。
|
|
18
|
+
|
|
19
|
+
## 命令
|
|
20
|
+
|
|
21
|
+
查看帮助
|
|
22
|
+
```shell
|
|
23
|
+
blg --help
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
生成一个示例博客目录
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
blg -n "C:\Users\ABC\Desktop\"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
生成静态页面
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
blg blg -o "C:\Users\ABC\Desktop\simple-blog\"
|
|
36
|
+
```
|
djhx_blogger-0.1.4/PKG-INFO
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: djhx-blogger
|
|
3
|
-
Version: 0.1.4
|
|
4
|
-
Summary: Add your description here
|
|
5
|
-
Requires-Python: >=3.9
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Requires-Dist: beautifulsoup4>=4.14.2
|
|
8
|
-
Requires-Dist: fabric>=3.2.2
|
|
9
|
-
Requires-Dist: jinja2>=3.1.6
|
|
10
|
-
Requires-Dist: markdown>=3.9
|
|
11
|
-
Requires-Dist: typer>=0.20.0
|
|
12
|
-
Dynamic: license-file
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: djhx-blogger
|
|
3
|
-
Version: 0.1.4
|
|
4
|
-
Summary: Add your description here
|
|
5
|
-
Requires-Python: >=3.9
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Requires-Dist: beautifulsoup4>=4.14.2
|
|
8
|
-
Requires-Dist: fabric>=3.2.2
|
|
9
|
-
Requires-Dist: jinja2>=3.1.6
|
|
10
|
-
Requires-Dist: markdown>=3.9
|
|
11
|
-
Requires-Dist: typer>=0.20.0
|
|
12
|
-
Dynamic: license-file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|