generated from Meekdai/Gmeek-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 929c97c
Showing
11 changed files
with
901 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: build Gmeek | ||
|
||
on: | ||
workflow_dispatch: | ||
issues: | ||
types: [opened, edited] | ||
schedule: | ||
- cron: "0 16 * * *" | ||
|
||
jobs: | ||
build: | ||
name: Generate blog | ||
runs-on: ubuntu-20.04 | ||
if: ${{ github.event.repository.owner.id == github.event.sender.id || github.event_name == 'schedule' }} | ||
permissions: write-all | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v4 | ||
|
||
- 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@v5 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Clone source code | ||
run: | | ||
GMEEK_VERSION=$(jq -r ".GMEEK_VERSION" config.json) | ||
git clone https://github.com/Meekdai/Gmeek.git /opt/Gmeek; | ||
cd /opt/Gmeek/ | ||
lastTag=$(git describe --tags `git rev-list --tags --max-count=1`) | ||
if [ $GMEEK_VERSION == 'last' ]; then git checkout $lastTag; else git checkout $GMEEK_VERSION; fi; | ||
- 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@v3 | ||
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@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## 【创建仓库】完成了 | ||
请接着按照下面的步骤2和3进行操作,全部成功之后,本`README.md`文件会自动替换掉的哦! | ||
|
||
### 安装 | ||
|
||
1. 【创建仓库】点击[通过模板创建仓库](https://github.com/new?template_name=Gmeek-template&template_owner=Meekdai),建议仓库名称为`XXX.github.io`,其中`XXX`为你的github用户名。 | ||
|
||
2. 【启用Pages】在本仓库的`Settings`中`Pages->Build and deployment->Source`下面选择`Github Actions`。 | ||
|
||
3. 【开始写作】打开一篇issue,开始写作,并且**必须**添加一个`标签Label`(至少添加一个),再保存issue后会自动创建博客内容,片刻后可通过https://XXX.github.io 访问(可进入Actions页面查看构建进度)。 | ||
|
||
4. 【手动全局生成】这个步骤只有在修改`config.json`文件或者出现奇怪问题的时候,需要执行。 | ||
``` | ||
通过Actions->build Gmeek->Run workflow->里面的按钮全局重新生成一次 | ||
``` | ||
|
||
### Powered by :heart: [Gmeek](https://github.com/Meekdai/Gmeek) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
如果你点击了`READM.md`的链接后,看到了这个页面,请继续之后的安装步骤执行。 | ||
|
||
成功后`READM.md`会出现你自己的博客地址,并且内容也会更新。 | ||
|
||
[Gmeek快速上手](https://blog.meekdai.com/post/Gmeek-kuai-su-shang-shou.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
通过这个模板创建库,可以大大减少部署Gmeek博客的配置步骤。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"title":"Blog Title", | ||
"subTitle":"Blog description", | ||
"avatarUrl":"https://github.githubassets.com/favicons/favicon.svg", | ||
"GMEEK_VERSION":"last" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
<!DOCTYPE html> | ||
<html data-color-mode="light" data-dark-theme="dark" data-light-theme="light" lang="zh-CN"> | ||
<head> | ||
<meta content="text/html; charset=utf-8" http-equiv="content-type" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<link href="//cdn.staticfile.org/Primer/21.0.7/primer.css" rel="stylesheet" /> | ||
<link rel="icon" href="https://github.githubassets.com/favicons/favicon.svg"> | ||
<script> | ||
if(localStorage.getItem("meek_theme")==null){} | ||
else if(localStorage.getItem("meek_theme")=="dark"){document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="dark";} | ||
else if(localStorage.getItem("meek_theme")=="light"){document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="light";} | ||
</script> | ||
|
||
<meta name="description" content="Blog description"> | ||
<title>Blog Title</title> | ||
|
||
</head> | ||
<style> | ||
body{box-sizing: border-box;min-width: 200px;max-width: 900px;margin: 20px auto;padding: 45px;font-size: 16px;font-family: sans-serif;line-height: 1.25;} | ||
#header{display:flex;padding-bottom:8px;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted));margin-bottom: 16px;} | ||
#footer {margin-top:64px; text-align: center;font-size: small;} | ||
|
||
</style> | ||
|
||
<style> | ||
.avatar {transition: 0.8s;width:64px;height:64px;object-fit: cover;} | ||
.avatar:hover{transform: scale(1.15) rotate(360deg);} | ||
#header h1 a{color:inherit;text-decoration:none;vertical-align: bottom;font-size:40px;font-family:Monaco;margin-left:8px;} | ||
.title-right{display:flex;margin:auto 0 0 auto;} | ||
.title-right button{margin-right:8px;padding:16px;} | ||
.title-right .circle{padding: 14px 16px;} | ||
|
||
.SideNav{min-width: 360px;} | ||
.SideNav-icon{margin-right: 16px} | ||
.SideNav-item .Label{color: #fff;margin-left:8px;} | ||
.d-flex{min-width:0;} | ||
.listTitle{overflow:hidden;white-space:nowrap;text-overflow: ellipsis;max-width: 100%;} | ||
.listLabels{white-space:nowrap;} | ||
.listLabels object{max-height:16px;max-width:24px;} | ||
|
||
@media (max-width: 600px) { | ||
body {padding: 8px;} | ||
.avatar {width:40px;height:40px;} | ||
.blogTitle{display:none;} | ||
#buttonRSS{display:none;} | ||
.LabelTime{display:none;} | ||
} | ||
</style> | ||
|
||
|
||
<body> | ||
<div id="header"> | ||
<h1> | ||
<img src="https://github.githubassets.com/favicons/favicon.svg" class="avatar circle" id="avatarImg" alt="avatar"><a class="blogTitle">Blog Title</a></h1> | ||
<div class="title-right"> | ||
<a href="https://Meekdai.github.io/Gmeek-template/tag.html"><button id="buttonSearch" class="btn btn-invisible circle" title="搜索"> | ||
<svg class="octicon" width="16" height="16" > | ||
<path id="pathSearch" fill-rule="evenodd"></path> | ||
</svg> | ||
</button></a> | ||
|
||
<a href="https://Meekdai.github.io/Gmeek-template/rss.xml" target="_blank"><button id="buttonRSS" class="btn btn-invisible circle" title="RSS"> | ||
<svg class="octicon" width="16" height="16" > | ||
<path id="pathRSS" fill-rule="evenodd"></path> | ||
</svg> | ||
</button></a> | ||
<button class="btn btn-invisible circle" onclick="modeSwitch()" title="切换主题"> | ||
<svg class="octicon" width="16" height="16" > | ||
<path id="themeSwitch" fill-rule="evenodd"></path> | ||
</svg> | ||
</button> | ||
</div> | ||
</div> | ||
<div id="content"> | ||
<div style="margin-bottom: 16px;">Blog description</div> | ||
<nav class="SideNav border"> | ||
<a class="SideNav-item d-flex flex-items-center flex-justify-between" href="post/qing-jie-zhao-zhi-hou-de-an-zhuang-bu-zou-zhi-xing.html"> | ||
<div class="d-flex flex-items-center"> | ||
<svg class="SideNav-icon octicon" style="witdh:16px;height:16px"><path class="svgTop0" d=""></path> | ||
</svg> | ||
<span class="listTitle">请接着之后的安装步骤执行</span> | ||
</div> | ||
<div class="listLabels"> | ||
|
||
<span class="Label LabelName" style="background-color:#0075ca"><object><a style="color:#fff" href="https://Meekdai.github.io/Gmeek-template/tag.html#documentation">documentation</a></object></span> | ||
<span class="Label LabelTime" style="background-color:#bc4c00">2024-03-14</span> | ||
</div> | ||
</a><a class="SideNav-item d-flex flex-items-center flex-justify-between" href="post/zhe-shi-Gmeek-mo-ban-cang-ku.html"> | ||
<div class="d-flex flex-items-center"> | ||
<svg class="SideNav-icon octicon" style="witdh:16px;height:16px"><path class="svgTop0" d=""></path> | ||
</svg> | ||
<span class="listTitle">这是Gmeek模板仓库</span> | ||
</div> | ||
<div class="listLabels"> | ||
|
||
<span class="Label LabelName" style="background-color:#7057ff"><object><a style="color:#fff" href="https://Meekdai.github.io/Gmeek-template/tag.html#good first issue">good first issue</a></object></span> | ||
<span class="Label LabelTime" style="background-color:#A333D0">2023-12-20</span> | ||
</div> | ||
</a> | ||
</nav> | ||
</div> | ||
<div id="footer">Copyright © <span id="year"></span><a href="https://Meekdai.github.io/Gmeek-template"> Blog Title </a> | ||
<p> | ||
<span id="runday"></span>Powered by <a href="https://meekdai.com/Gmeek.html" target="_blank">Gmeek</a> | ||
</p> | ||
|
||
<script> | ||
if(""!=""){ | ||
var now=new Date(); | ||
var startSite=new Date(""); | ||
var diff=now.getTime()-startSite.getTime(); | ||
var diffDay=Math.floor(diff/(1000*60*60*24)); | ||
document.getElementById("year").innerHTML=now.getFullYear(); | ||
if(""!=""){document.getElementById("runday").innerHTML=" • "+"网站运行"+diffDay+"天"+" • ";} | ||
else{document.getElementById("runday").innerHTML="网站运行"+diffDay+"天"+" • ";} | ||
} | ||
</script> | ||
</div> | ||
</body> | ||
<script> | ||
var IconList={'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', 'about': 'M10.561 8.073a6.005 6.005 0 0 1 3.432 5.142.75.75 0 1 1-1.498.07 4.5 4.5 0 0 0-8.99 0 .75.75 0 0 1-1.498-.07 6.004 6.004 0 0 1 3.431-5.142 3.999 3.999 0 1 1 5.123 0ZM10.5 5a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z', 'sun': 'M8 10.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zM8 12a4 4 0 100-8 4 4 0 000 8zM8 0a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0V.75A.75.75 0 018 0zm0 13a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 018 13zM2.343 2.343a.75.75 0 011.061 0l1.06 1.061a.75.75 0 01-1.06 1.06l-1.06-1.06a.75.75 0 010-1.06zm9.193 9.193a.75.75 0 011.06 0l1.061 1.06a.75.75 0 01-1.06 1.061l-1.061-1.06a.75.75 0 010-1.061zM16 8a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0116 8zM3 8a.75.75 0 01-.75.75H.75a.75.75 0 010-1.5h1.5A.75.75 0 013 8zm10.657-5.657a.75.75 0 010 1.061l-1.061 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zm-9.193 9.193a.75.75 0 010 1.06l-1.06 1.061a.75.75 0 11-1.061-1.06l1.06-1.061a.75.75 0 011.061 0z', 'moon': 'M9.598 1.591a.75.75 0 01.785-.175 7 7 0 11-8.967 8.967.75.75 0 01.961-.96 5.5 5.5 0 007.046-7.046.75.75 0 01.175-.786zm1.616 1.945a7 7 0 01-7.678 7.678 5.5 5.5 0 107.678-7.678z', 'search': 'M15.7 13.3l-3.81-3.83A5.93 5.93 0 0 0 13 6c0-3.31-2.69-6-6-6S1 2.69 1 6s2.69 6 6 6c1.3 0 2.48-.41 3.47-1.11l3.83 3.81c.19.2.45.3.7.3.25 0 .52-.09.7-.3a.996.996 0 0 0 0-1.41v.01zM7 10.7c-2.59 0-4.7-2.11-4.7-4.7 0-2.59 2.11-4.7 4.7-4.7 2.59 0 4.7 2.11 4.7 4.7 0 2.59-2.11 4.7-4.7 4.7z', 'rss': 'M2.002 2.725a.75.75 0 0 1 .797-.699C8.79 2.42 13.58 7.21 13.974 13.201a.75.75 0 0 1-1.497.098 10.502 10.502 0 0 0-9.776-9.776.747.747 0 0 1-.7-.798ZM2.84 7.05h-.002a7.002 7.002 0 0 1 6.113 6.111.75.75 0 0 1-1.49.178 5.503 5.503 0 0 0-4.8-4.8.75.75 0 0 1 .179-1.489ZM2 13a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z', 'upload': 'M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z M11.78 4.72a.749.749 0 1 1-1.06 1.06L8.75 3.811V9.5a.75.75 0 0 1-1.5 0V3.811L5.28 5.78a.749.749 0 1 1-1.06-1.06l3.25-3.25a.749.749 0 0 1 1.06 0l3.25 3.25Z', 'github': 'M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z', 'home': 'M6.906.664a1.749 1.749 0 0 1 2.187 0l5.25 4.2c.415.332.657.835.657 1.367v7.019A1.75 1.75 0 0 1 13.25 15h-3.5a.75.75 0 0 1-.75-.75V9H7v5.25a.75.75 0 0 1-.75.75h-3.5A1.75 1.75 0 0 1 1 13.25V6.23c0-.531.242-1.034.657-1.366l5.25-4.2Zm1.25 1.171a.25.25 0 0 0-.312 0l-5.25 4.2a.25.25 0 0 0-.094.196v7.019c0 .138.112.25.25.25H5.5V8.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 .75.75v5.25h2.75a.25.25 0 0 0 .25-.25V6.23a.25.25 0 0 0-.094-.195Z'}; | ||
var utterancesLoad=0; | ||
if(localStorage.getItem("meek_theme")==null){localStorage.setItem("meek_theme","light");changeLight();} | ||
else if(localStorage.getItem("meek_theme")=="dark"){changeDark();} | ||
else if(localStorage.getItem("meek_theme")=="light"){changeLight();} | ||
|
||
function changeDark(){ | ||
document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="dark"; | ||
document.getElementById("themeSwitch").setAttribute("d",value=IconList["moon"]); | ||
document.getElementById("themeSwitch").parentNode.style.color="#00f0ff"; | ||
if(utterancesLoad==1){utterancesTheme("dark-blue");} | ||
} | ||
function changeLight(){ | ||
document.getElementsByTagName("html")[0].attributes.getNamedItem("data-color-mode").value="light"; | ||
document.getElementById("themeSwitch").setAttribute("d",value=IconList["sun"]); | ||
document.getElementById("themeSwitch").parentNode.style.color="#ff5000"; | ||
if(utterancesLoad==1){utterancesTheme("github-light");} | ||
} | ||
function modeSwitch(){ | ||
if(document.getElementsByTagName("html")[0].attributes[0].value=="light"){changeDark();localStorage.setItem("meek_theme","dark");} | ||
else{changeLight();localStorage.setItem("meek_theme","light");} | ||
} | ||
function utterancesTheme(theme){ | ||
const message = {type: 'set-theme',theme: theme}; | ||
const iframe = document.getElementsByClassName('utterances-frame')[0]; | ||
iframe.contentWindow.postMessage(message, 'https://utteranc.es'); | ||
} | ||
|
||
console.log("\n %c Gmeek last %c https://github.com/Meekdai/Gmeek \n\n", "color: #fff; background-image: linear-gradient(90deg, rgb(47, 172, 178) 0%, rgb(45, 190, 96) 100%); padding:5px 1px;", "background-image: linear-gradient(90deg, rgb(45, 190, 96) 0%, rgb(255, 255, 255) 100%); padding:5px 0;"); | ||
</script> | ||
|
||
<script> | ||
document.getElementById("pathSearch").setAttribute("d",IconList["search"]); | ||
document.getElementById("pathRSS").setAttribute("d",IconList["rss"]); | ||
iconTOP=document.getElementsByClassName("svgTop1"); | ||
iconPost=document.getElementsByClassName("svgTop0"); | ||
for(var i=0;i<iconTOP.length;i++){ | ||
iconTOP[i].setAttribute("d",IconList["upload"]); | ||
iconTOP[i].parentNode.style.color="red"; | ||
} | ||
for(var i=0;i<iconPost.length;i++){ | ||
iconPost[i].setAttribute("d",IconList["post"]); | ||
} | ||
|
||
|
||
</script> | ||
|
||
</html> |
Oops, something went wrong.