再一次简化搭建流程,真18秒搭建完成
This commit is contained in:
parent
9306186f85
commit
0632986060
124
CONIFG.md
124
CONIFG.md
@ -1,124 +0,0 @@
|
||||
# 配置文件说明
|
||||
|
||||
### `config.json` 文件
|
||||
|
||||
```javascript
|
||||
{
|
||||
"title":"Meekdai",
|
||||
"displayTitle":"eekdai",
|
||||
"subTitle":"童话是一种生活态度,仅此而已。",
|
||||
"homeUrl":"http://blog.meekdai.com",
|
||||
"avatarUrl":"http://meekdai.com/avatar.jpg",
|
||||
"faviconUrl":"http://meekdai.com/favicon.ico",
|
||||
"singlePage":["link","about"],
|
||||
"GMEEK_VERSION":"v2.5"
|
||||
}
|
||||
```
|
||||
|
||||
以上是必须的字段,修改为自己的信息即可,下面是可以自定义字段的描述,可以选择加入到`config.json`中。
|
||||
|
||||
```javascript
|
||||
"email":"meekdai@163.com",
|
||||
"startSite":"02/16/2015",
|
||||
"filingNum":"浙ICP备20023628号",
|
||||
"onePageListNum":15,
|
||||
"commentLabelColor":"#006b75",
|
||||
"yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],
|
||||
"i18n":"CN",
|
||||
"dayTheme":"light",
|
||||
"nightTheme":"dark_colorblind",
|
||||
"urlMode":"pinyin",
|
||||
```
|
||||
另有不清楚的也可以参考 https://github.com/Meekdai/meekdai.github.io/blob/main/config.json
|
||||
|
||||
|
||||
### `.github/workflows/Gmeek.yml` 文件
|
||||
|
||||
此文件保存到指定目录即可,无需修改。
|
||||
|
||||
```yml
|
||||
name: build Gmeek
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Generate blog
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event.repository.owner.id == github.event.sender.id
|
||||
permissions: write-all
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v3
|
||||
|
||||
- name: Get config.json
|
||||
run: |
|
||||
echo "====== check config.josn file ======"
|
||||
cat config.json
|
||||
echo "====== check config.josn end ======"
|
||||
sudo apt-get install jq
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Clone source code
|
||||
run: |
|
||||
git clone -b $(jq -r ".GMEEK_VERSION" config.json) https://github.com/Meekdai/Gmeek.git /opt/Gmeek
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install -r /opt/Gmeek/requirements.txt
|
||||
|
||||
- name: Generate new html
|
||||
run: |
|
||||
cp -r ./* /opt/Gmeek/
|
||||
cd /opt/Gmeek/
|
||||
python Gmeek.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} --issue_number '${{ github.event.issue.number }}'
|
||||
cp -a /opt/Gmeek/docs ${{ github.workspace }}
|
||||
cp -a /opt/Gmeek/backup ${{ github.workspace }}
|
||||
cp /opt/Gmeek/blogBase.json ${{ github.workspace }}
|
||||
|
||||
- name: update html
|
||||
run: |
|
||||
git config --local user.email "$(jq -r ".email" config.json)"
|
||||
git config --local user.name "${{ github.repository_owner }}"
|
||||
git add .
|
||||
git commit -a -m '🎉auto update by Gmeek action' || echo "nothing to commit"
|
||||
git push || echo "nothing to push"
|
||||
sleep 3
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
with:
|
||||
path: 'docs/.'
|
||||
|
||||
deploy:
|
||||
name: Deploy blog
|
||||
runs-on: ubuntu-20.04
|
||||
needs: build
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
||||
|
||||
```
|
||||
42
README.md
42
README.md
@ -1,7 +1,7 @@
|
||||
**简体中文** | **[English](README-en.md)**
|
||||
# Gmeek
|
||||
|
||||
一个博客框架,超轻量级个人博客模板。完全基于`Github Pages` 、 `Github Issues` 和 `Github Actions`。不需要本地部署,从搭建到写作,只需要几分钟的时间,3步搭建好博客,第4步就是写作。
|
||||
一个博客框架,超轻量级个人博客模板。完全基于`Github Pages` 、 `Github Issues` 和 `Github Actions`。不需要本地部署,从搭建到写作,只需要几分钟的时间,2步搭建好博客,第3步就是写作。
|
||||
|
||||
- [Demo页面](http://meekdai.github.io/)
|
||||
- [更新日志](https://meekdai.github.io/post/Gmeek-geng-xin-ri-zhi.html)
|
||||
@ -10,12 +10,13 @@
|
||||
|
||||
### 安装
|
||||
|
||||
1. 创建自己的`XXX.github.io`的仓库,在仓库的设置中`Pages->Build and deployment->Source`下面选择`Github Actions`。
|
||||
2. 在仓库中创建文件`config.json`和`.github/workflows/Gmeek.yml`复制[链接](CONIFG.md)中的代码分别保存。
|
||||
3. 在Issues中删除多余标签,创建自己的标签,如`link`、`about`、`日常`等。
|
||||
4. 打开一篇issue,开始写作,并且添加一个标签,保存issue后会自动创建博客内容,片刻后可通过https://XXX.github.io 访问
|
||||
1. 点击[创建仓库](https://github.com/new?template_name=Gmeek-template&template_owner=Meekdai),建议仓库名称为`XXX.github.io`,其中`XXX`为你的github用户名。
|
||||
|
||||
如果有问题可在本仓库提交[Issues](https://github.com/Meekdai/Gmeek/issues) 或者添加 QQ:`294977308`
|
||||
2. 在你创建好的仓库的设置`Settings`中`Pages->Build and deployment->Source`下面选择`Github Actions`。
|
||||
|
||||
3. 打开一篇issue,开始写作,并且添加一个标签,保存issue后会自动创建博客内容,片刻后可通过https://XXX.github.io 访问
|
||||
|
||||
如果有问题可在本仓库提交[Issues](https://github.com/Meekdai/Gmeek/issues)
|
||||
|
||||
### 特性
|
||||
|
||||
@ -53,7 +54,36 @@
|
||||
7. 如果在评论里面登录后评论报错,可直接按照提示安装`utteranc app`即可
|
||||
> Error: utterances is not installed on xxx/xxx.github.io. If you own this repo, install the app. Read more about this change in the PR.
|
||||
|
||||
### 配置文件
|
||||
|
||||
`config.json` 文件
|
||||
```javascript
|
||||
{
|
||||
"title":"Meekdai",
|
||||
"displayTitle":"eekdai",
|
||||
"subTitle":"童话是一种生活态度,仅此而已。",
|
||||
"homeUrl":"http://blog.meekdai.com",
|
||||
"avatarUrl":"http://meekdai.com/avatar.jpg",
|
||||
"faviconUrl":"http://meekdai.com/favicon.ico",
|
||||
"singlePage":[],
|
||||
"GMEEK_VERSION":"last"
|
||||
}
|
||||
```
|
||||
以上是必须的字段,修改为自己的信息即可,下面是可以自定义字段的描述,可以选择加入到`config.json`中。
|
||||
|
||||
```javascript
|
||||
"email":"meekdai@163.com",
|
||||
"startSite":"02/16/2015",
|
||||
"filingNum":"浙ICP备20023628号",
|
||||
"onePageListNum":15,
|
||||
"commentLabelColor":"#006b75",
|
||||
"yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],
|
||||
"i18n":"CN",
|
||||
"dayTheme":"light",
|
||||
"nightTheme":"dark_colorblind",
|
||||
"urlMode":"pinyin",
|
||||
```
|
||||
另有不清楚的也可以参考 https://github.com/Meekdai/meekdai.github.io/blob/main/config.json
|
||||
|
||||
|
||||
### 鸣谢
|
||||
|
||||
Loading…
Reference in New Issue
Block a user