升级版本号到v2.0
This commit is contained in:
parent
3495bf8b1d
commit
49e2f3c795
@ -19,7 +19,7 @@
|
|||||||
"commentLabelColor":"#006b75",
|
"commentLabelColor":"#006b75",
|
||||||
"yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],
|
"yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],
|
||||||
"i18n":"CN",
|
"i18n":"CN",
|
||||||
"GMEEK_VERSION":"v1.2"
|
"GMEEK_VERSION":"v2.0"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
12
Gmeek.py
12
Gmeek.py
@ -12,7 +12,8 @@ from xpinyin import Pinyin
|
|||||||
from feedgen.feed import FeedGenerator
|
from feedgen.feed import FeedGenerator
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
######################################################################################
|
######################################################################################
|
||||||
i18n={"Search":"搜索","switchTheme":"切换主题","link":"友情链接","home":"首页","comments":"评论","run":"网站运行","days":"天"}
|
i18n={"Search":"Search","switchTheme":"switch theme","link":"link","home":"home","comments":"comments","run":"run","days":"days"}
|
||||||
|
i18nCN={"Search":"搜索","switchTheme":"切换主题","link":"友情链接","home":"首页","comments":"评论","run":"网站运行","days":"天"}
|
||||||
IconPlist={
|
IconPlist={
|
||||||
"post":"M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25Zm1.75-.25a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25ZM3.5 6.25a.75.75 0 0 1 .75-.75h7a.75.75 0 0 1 0 1.5h-7a.75.75 0 0 1-.75-.75Zm.75 2.25h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1 0-1.5Z",
|
"post":"M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25Zm1.75-.25a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25ZM3.5 6.25a.75.75 0 0 1 .75-.75h7a.75.75 0 0 1 0 1.5h-7a.75.75 0 0 1-.75-.75Zm.75 2.25h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1 0-1.5Z",
|
||||||
"link":"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z",
|
"link":"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z",
|
||||||
@ -54,6 +55,11 @@ class GMEEK():
|
|||||||
self.blogBase["GMEEK_VERSION"]=options.Gmeek_version
|
self.blogBase["GMEEK_VERSION"]=options.Gmeek_version
|
||||||
self.blogBase["postListJson"]=json.loads('{}')
|
self.blogBase["postListJson"]=json.loads('{}')
|
||||||
|
|
||||||
|
if self.blogBase["i18n"]=="CN":
|
||||||
|
self.i18n=i18nCN
|
||||||
|
else:
|
||||||
|
self.i18n=i18n
|
||||||
|
|
||||||
def cleanFile(self):
|
def cleanFile(self):
|
||||||
if os.path.exists(self.backup_dir):
|
if os.path.exists(self.backup_dir):
|
||||||
shutil.rmtree(self.backup_dir)
|
shutil.rmtree(self.backup_dir)
|
||||||
@ -105,7 +111,7 @@ class GMEEK():
|
|||||||
file_loader = FileSystemLoader('templates')
|
file_loader = FileSystemLoader('templates')
|
||||||
env = Environment(loader=file_loader)
|
env = Environment(loader=file_loader)
|
||||||
template = env.get_template('post.html')
|
template = env.get_template('post.html')
|
||||||
output = template.render(blogBase=postBase,i18n=i18n,IconList=IconPost)
|
output = template.render(blogBase=postBase,i18n=self.i18n,IconList=IconPost)
|
||||||
|
|
||||||
f = open(gen_Html, 'w', encoding='UTF-8')
|
f = open(gen_Html, 'w', encoding='UTF-8')
|
||||||
f.write(output)
|
f.write(output)
|
||||||
@ -117,7 +123,7 @@ class GMEEK():
|
|||||||
file_loader = FileSystemLoader('templates')
|
file_loader = FileSystemLoader('templates')
|
||||||
env = Environment(loader=file_loader)
|
env = Environment(loader=file_loader)
|
||||||
template = env.get_template('plist.html')
|
template = env.get_template('plist.html')
|
||||||
output = template.render(blogBase=self.blogBase,postListJson=self.blogBase["postListJson"],i18n=i18n,IconList=IconPlist)
|
output = template.render(blogBase=self.blogBase,postListJson=self.blogBase["postListJson"],i18n=self.i18n,IconList=IconPlist)
|
||||||
|
|
||||||
f = open(self.root_dir+"index.html", 'w', encoding='UTF-8')
|
f = open(self.root_dir+"index.html", 'w', encoding='UTF-8')
|
||||||
f.write(output)
|
f.write(output)
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
- UI界面和Github同源,只引入了Github原生CSS:[primer.style](https://primer.style/css)
|
- UI界面和Github同源,只引入了Github原生CSS:[primer.style](https://primer.style/css)
|
||||||
- 博客写作在Issues中完成后,自动触发Actions执行部署任务
|
- 博客写作在Issues中完成后,自动触发Actions执行部署任务
|
||||||
- 评论系统引入[utteranc.es](https://utteranc.es/)
|
- 评论系统引入[utteranc.es](https://utteranc.es/)
|
||||||
|
- 使用jinja2对html进行渲染,可通过模板自定义UI主题
|
||||||
|
|
||||||
### 说明
|
### 说明
|
||||||
1. 请确保每一篇文章有且仅有一个`Label`,为了防止他人提交的Issue也被抓取生成文章。
|
1. 请确保每一篇文章有且仅有一个`Label`,为了防止他人提交的Issue也被抓取生成文章。
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user