Skip to content

Commit

Permalink
Update blog - 2024-11-08 16:18:43
Browse files Browse the repository at this point in the history
  • Loading branch information
aliceric27 committed Nov 8, 2024
1 parent d350624 commit 23e85b9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ deploy:
- type: git # 使用 Git 部署
repo: https://github.com/aliceric27/aliceric27.github.io.git # 你的儲存庫 clone
branch: gh-pages # 儲存庫分支
message: "Update blog {{ now('YYYY-MM-DD HH:mm:ss') }}" # Commit 訊息
message: "Update blog - 2024-11-08 16:18:43" # Commit 訊息
21 changes: 21 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# 獲取當前日期和時間
current_date_time=$(date "+%Y-%m-%d %H:%M:%S")

# 使用 sed 進行就地替換
# 對於 macOS 的 sed,我們需要給 -i 選項一個空的擴展名參數 ('')
# 對於 GNU sed(Linux),不需要額外的擴展名,所以這裡使用了一個條件判斷來兼容 macOS 和 Linux
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/message: \"[^\"]*\"/message: \"Update blog - $current_date_time\"/" _config.yml
else
sed -i "s/message: \"[^\"]*\"/message: \"Update blog - $current_date_time\"/" _config.yml
fi

# 清理、生成和部署網站
hexo clean && hexo g && hexo deploy

# 添加變更到 Git,提交和推送
git add .
git commit -m "Update blog - $current_date_time"
git push origin main
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"g": "hexo generate",
"c": "hexo clean",
"d": "hexo clean && hexo deploy",
"d": "bash deploy.sh",
"s": "hexo server"
},
"hexo": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<meta property="og:image" content="https://github.com/aliceric27/picx-images-hosting/raw/master/image.4n7q82irf3.webp">
<meta property="og:image" content="https://github.com/aliceric27/picx-images-hosting/raw/master/image.70acpa5g8u.webp">
<meta property="article:published_time" content="2024-11-07T13:20:20.000Z">
<meta property="article:modified_time" content="2024-11-08T05:27:23.084Z">
<meta property="article:modified_time" content="2024-11-08T08:14:59.003Z">
<meta property="article:author" content="Wei">
<meta property="article:tag" content="Tools">
<meta name="twitter:card" content="summary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ categories:
- [Tools]
---


使用 CloudFlare 免費提供的 Worker 服務作為 Telegram Bot 的 Server

<!-- more -->
Expand All @@ -27,7 +27,7 @@ categories:
[nodejs.org](https://nodejs.org/en) 下載對應版本安裝

確認是否安裝成功

```bash
node -v
```
Expand Down

0 comments on commit 23e85b9

Please sign in to comment.