-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
42 lines (34 loc) · 1.15 KB
/
Copy pathsettings.py
File metadata and controls
42 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# srcdir = r'D:\Blog\test\srcdocs'
# dstdir = r'D:\Blog\test\web\docs'
# assetdir = r'D:\Blog\test\web\docs\asset'
# config_dir = r'D:\Blog\test\web\configs'
srcdir = r'D:\Blog\done'
# dstdir = r'D:\Blog\masterAllen.github.io'
dstdir = r'D:\BlogSite\masterAllen.github.io'
import os
from pathlib import Path
# 基于 settings.py 所在目录计算路径,不依赖 os.chdir
_script_dir = Path(__file__).resolve().parent
script_dir = str(_script_dir)
config_dir = str(_script_dir / 'configs')
overrides_dir = str(_script_dir / 'overrides')
docsdir = os.path.join(dstdir, 'docs')
assetdir = os.path.join(docsdir, 'asset')
special_dirs = [
'材料',
'paper',
'papers',
'asset',
'code',
'codes',
'source'
]
skip_types = {'web', 'base64', 'unknown'}
MAX_FILE_SIZE = 10 * 1024 * 1024 # 10MB
# 图片压缩参数(main5.py)
IMAGE_OPTIMIZATION = {
'jpg_quality': 85, # JPEG 质量 (1-100)
# pngquant --quality=min-max;区间过窄易导致 exit 99(达不到最低质量)
'png_quality': (65, 80), # (min, max),或字符串 '65-95'
'max_width': 1920, # 仅限制最大宽度,超过则等比缩小
}