Skip to main content
  1. Maoli's Digital Garden/

Maintaining Personal Homepage

·213 words·1 min

Thank Zhuohua for helping me set up my personal homepage. This note records the process of maintaining the homepage.

Cloning the Repository #

The blog repository stores the source code of the website, primarily markdown files. Use the following command to clone:

git clone --recurse-submodules [email protected]:maoli17/blog.git

It includes two submodules: public and themes/, which store the generated HTML and theme templates, respectively.

Updating the Template #

To update the template from upstream, first enter the template directory:

cd blog/themes/<theme-name>

Then add the upstream GitHub address and pull the updates:

git remote add upstream [email protected]:<author>/<theme-name>.git

git pull upstream master

At this point, there may be conflicts that need to be resolved manually. After resolving them, commit your changes:

git add .
git commit -m "update theme"

You may be prompted that HEAD is detached at this point. Use the following command to resolve it:

# Force the master branch to point to the current position of HEAD
git branch -f master HEAD

# Check out the master branch
git checkout master

Finally, push to GitHub:

git push

Updating the Homepage #

After editing the markdown, run the script, which will automatically upload the HTML generated by hugo to the public repository.

Then proceed with the normal add, commit, and push operations to update the blog folder.