Closed 1chooo closed 2 months ago
I write a new build.sh
to replace with hexo deploy
, and it successfully fixed this issue
#!/bin/bash
# Author: Hugo ChunHo Lin
# Date: 2024/03/30
# Version: v0.0.1
# Delete the gh-pages branch
git branch -D gh-pages
# Clean up the public folder
hexo clean
# Generate static files
hexo generate
# Clear the contents of .deploy_git folder
rm -rf .deploy_git/*
# Copy contents from public folder to .deploy_git folder
cp -r public/* .deploy_git/
# Create or overwrite CNAME file with desired content
echo "YOUR_OWN_DOMAIN" > .deploy_git/CNAME
# Commit and push changes to gh-pages branch
timestamp=$(date +"%Y-%m-%d %T")
commit_message="feat: site updated $timestamp"
cd .deploy_git || exit
git init
git add .
git commit -m "$commit_message"
git remote add origin <YOUR_REPOSITORY_URL> # Replace <repository_url> with your actual repository URL
git checkout -b gh-pages
git push -u origin gh-pages
提交 Issue 前检查清单
hexo clean
,问题仍然存在Bug 描述
我想為我的 Blog 換成我的域名,不過每次 GitHub Repo 裡的 CNAME 都會被自動刪除,導致出現 404 Error。
已經將
_config.redefine.yml
的info.url
更換成我的 urlhttps://blog.1chooo.com
同樣config.yml
的url
也更換成我的 urlhttps://blog.1chooo.com
复现方法
重新 deploy 到 github
预期结果
github-page 這個 branch 的
CNAME
會保留截图
电脑操作系统
macOS
浏览器
Brave
版本
v1.64.109
移动端设备
MacBook Pro 2020 intel
移动端操作系统
No response
浏览器
No response
版本
No response
其他
想問作者是如何把 Domain 更換成自己的?