Only store the content and some scripts here. For website repository, please refer to blog-website.
-
Clone template branch
git clone -b template https://github.com/laishere/blog.git
-
Rename as your main branch
git branch -M main
-
Install dependencies
npm install
-
Write some posts like this repository
-
Generate the posts meta locally
npm run dev
-
Update
VITE_LOCAL_CONTENT_DIR
in website project's.env
and run the website locally
Content
- Create a GitHub repository
- Allow
write
permission for actions in repository settings - Push to remote
- Check if the action is performed normally
Website
- Generate a
PAT
for the website and set it in the website project.env
- Deploy website
What's more, for purging cache of the website, please setup an environment variable for this repository: PURGE_CACHE_URL=http://<YOUR-DOMAIN>/cache/purge/<YOUR-VITE_CACHE_PURGE_SECRET>
. You may want to set it in the local .env
file and run npm run dev
first to verify the URL is correct.