Skip to content

Commit 858d201

Browse files
author
feijianwu
committed
v0.1.0
0 parents  commit 858d201

File tree

95 files changed

+38464
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+38464
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.idea
2+
.DS_Store
3+
tests/.swallow
4+
build
5+
dist
6+
.eggs
7+
*.app
8+
*.dist
9+
*.build

.vscode/launch.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Python: File",
5+
"type": "python",
6+
"request": "launch",
7+
"program": "${file}",
8+
"justMyCode": true
9+
}
10+
]
11+
}

.workflow/branch-pipeline.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
version: '1.0'
2+
name: branch-pipeline
3+
displayName: BranchPipeline
4+
stages:
5+
- stage:
6+
name: compile
7+
displayName: 编译
8+
steps:
9+
- step: build@python
10+
name: build_python
11+
displayName: Python 构建
12+
pythonVersion: '3.9'
13+
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
14+
artifacts:
15+
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
16+
- name: BUILD_ARTIFACT
17+
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
18+
path:
19+
- ./
20+
commands:
21+
- python3 -m pip install --upgrade pip
22+
- pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
23+
- pip3 install -r requirements.txt
24+
- python3 ./main.py
25+
- step: publish@general_artifacts
26+
name: publish_general_artifacts
27+
displayName: 上传制品
28+
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
29+
dependArtifact: BUILD_ARTIFACT
30+
# 上传到制品库时的制品命名,默认output
31+
artifactName: output
32+
dependsOn: build_python
33+
- stage:
34+
name: release
35+
displayName: 发布
36+
steps:
37+
- step: publish@release_artifacts
38+
name: publish_release_artifacts
39+
displayName: '发布'
40+
# 上游上传制品任务的产出
41+
dependArtifact: output
42+
# 发布制品版本号
43+
version: '1.0.0.0'
44+
# 是否开启版本号自增,默认开启
45+
autoIncrement: true
46+
triggers:
47+
push:
48+
branches:
49+
exclude:
50+
- master
51+
include:
52+
- .*

.workflow/master-pipeline.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: '1.0'
2+
name: master-pipeline
3+
displayName: MasterPipeline
4+
stages:
5+
- stage:
6+
name: compile
7+
displayName: 编译
8+
steps:
9+
- step: build@python
10+
name: build_python
11+
displayName: Python 构建
12+
pythonVersion: '3.9'
13+
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
14+
artifacts:
15+
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
16+
- name: BUILD_ARTIFACT
17+
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
18+
path:
19+
- ./
20+
commands:
21+
- python3 -m pip install --upgrade pip
22+
- pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
23+
- pip3 install -r requirements.txt
24+
- python3 ./main.py
25+
- step: publish@general_artifacts
26+
name: publish_general_artifacts
27+
displayName: 上传制品
28+
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
29+
dependArtifact: BUILD_ARTIFACT
30+
# 上传到制品库时的制品命名,默认output
31+
artifactName: output
32+
dependsOn: build_python
33+
- stage:
34+
name: release
35+
displayName: 发布
36+
steps:
37+
- step: publish@release_artifacts
38+
name: publish_release_artifacts
39+
displayName: '发布'
40+
# 上游上传制品任务的产出
41+
dependArtifact: output
42+
# 发布制品版本号
43+
version: '1.0.0.0'
44+
# 是否开启版本号自增,默认开启
45+
autoIncrement: true
46+
triggers:
47+
push:
48+
branches:
49+
include:
50+
- master

.workflow/pr-pipeline.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '1.0'
2+
name: pr-pipeline
3+
displayName: PRPipeline
4+
stages:
5+
- stage:
6+
name: compile
7+
displayName: 编译
8+
steps:
9+
- step: build@python
10+
name: build_python
11+
displayName: Python 构建
12+
pythonVersion: '3.9'
13+
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
14+
artifacts:
15+
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
16+
- name: BUILD_ARTIFACT
17+
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
18+
path:
19+
- ./
20+
commands:
21+
- python3 -m pip install --upgrade pip
22+
- pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
23+
- pip3 install -r requirements.txt
24+
- python3 ./main.py
25+
- step: publish@general_artifacts
26+
name: publish_general_artifacts
27+
displayName: 上传制品
28+
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
29+
dependArtifact: BUILD_ARTIFACT
30+
# 上传到制品库时的制品命名,默认output
31+
artifactName: output
32+
dependsOn: build_python
33+
triggers:
34+
pr:
35+
branches:
36+
include:
37+
- master

README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Swallow
2+
3+
> All those moments will be lost in time, like tears in rain.
4+
5+
Swallow 是一个简单的静态博客写作客户端。Swallow 的宗旨就是`简单`。即使是一个"小白"用户也可以使用 Swallow 搭建自己的博客系统。使用 Swallow。你不需要懂`HTML``CSS``Javascript``网络`
6+
`命令行``配置文件`等等编程和网络相关的知识。
7+
8+
你只需要会使用软件。然后学一点 [Markdown](https://markdown.com.cn/)(一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档)语法。就可以开始创建自己的个人博客网站了。
9+
10+
**开启你的博客之旅吧**
11+
12+
## 特性
13+
14+
- 使用 Markdown 创作你的博客
15+
- 可以对文章分组和添加标签
16+
- 支持 Windows 和 MacOS 客户端
17+
- 可以本地预览博客站点
18+
- 支持多种远程部署方式
19+
1. [COS(腾讯云对象存储服务)](./doc/cos_deploy.md)
20+
2. [Github Page](./doc/github_deploy.md)
21+
3. [Gitee Page](./doc/gitee_deploy.md)
22+
- 支持 Hugo 主题,其中内置主题开箱即用
23+
- 本地存储文章源文件
24+
25+
## 界面
26+
27+
![软件界面](./doc/imgs/article.png)
28+
29+
![side](./doc/imgs/editor.png)
30+
31+
![home](./doc/imgs/site_conf.png)
32+
33+
![home](./doc/imgs/remote_conf.png)
34+
35+
![home](./doc/imgs/preview.png)
36+
37+
## 开发
38+
39+
> 欢迎各位参与一起开发
40+
41+
### 使用的技术
42+
43+
- [PySide6](https://doc.qt.io/qtforpython/),qt for python,基于 Python 使用 Qt 开发界面
44+
- [Hugo](https://gohugo.io/),静态博客生成引擎
45+
- [Nuitka](https://nuitka.net/pages/donations.html),python 打包工具,将 python 程序打包成 Windows、MacOS 和 Linux 可执行程序
46+
47+
### 详细文档
48+
49+
可以参考作者相关的博客。

build.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import os
2+
import sys
3+
from pathlib import Path
4+
5+
import nuitka
6+
7+
pkg_path = Path(nuitka.__file__).parent.parent
8+
9+
if sys.platform == "darwin":
10+
try:
11+
cmd = f'''
12+
python -m nuitka --follow-imports --enable-plugin=pyside6 --standalone --macos-create-app-bundle \
13+
--macos-app-icon=logo.png \
14+
--nofollow-import-to=objc \
15+
--nofollow-import-to=numpy \
16+
--include-data-dir=lib=lib \
17+
--include-package=markdown.extensions \
18+
--include-package=pygments.lexers \
19+
--include-module=pygments.formatters.html \
20+
--include-module=pygments.styles.default \
21+
--include-data-dir={pkg_path}/objc=objc \
22+
--include-data-dir={pkg_path}/PyObjCTools=PyObjCTools \
23+
--include-module=plistlib \
24+
--include-package=pkg_resources \
25+
main.py
26+
'''
27+
os.system(cmd)
28+
print(cmd)
29+
except Exception as e:
30+
print(e)

doc/cos_deploy.md

Whitespace-only changes.

doc/gitee_deploy.md

Whitespace-only changes.

doc/github_deploy.md

Whitespace-only changes.

doc/imgs/article.png

316 KB
Loading

doc/imgs/editor.png

872 KB
Loading

doc/imgs/preview.png

398 KB
Loading

doc/imgs/remote_conf.png

287 KB
Loading

doc/imgs/site_conf.png

340 KB
Loading

exec/hugo

55.2 MB
Binary file not shown.

exec/hugo.exe

54.3 MB
Binary file not shown.

lib/config.toml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
baseURL = "http://local:1313/"
2+
languageCode = "zh-cn"
3+
defaultContentLanguage = "zh"
4+
title = "swallow"
5+
description = "this is my first blogs"
6+
theme = "mini"
7+
copyright = ""
8+
buildFuture = true
9+
10+
[author]
11+
name = "swallow"
12+
13+
[menu]
14+
main = [
15+
{ identifier = "home", name = "Home", url = "/", weight = 1 },
16+
{ identifier = "articles", name = "Articles", url = "/post", weight = 2 },
17+
{ identifier = "categories", name = "Categories", url = "/categories", weight = 3 },
18+
{ identifier = "tags", name = "Tags", url = "/tags", weight = 4 },
19+
{ identifier = "about", name = "About", url = "/about", weight = 5 },
20+
]
21+
22+
[params]
23+
hiddenPostSummaryInHomePage = true

lib/themes.zip

9.03 MB
Binary file not shown.

logo.png

23.2 KB
Loading

logo/logo.png

66.5 KB
Loading

0 commit comments

Comments
 (0)