blog/scripts
2025-05-27 11:42:04 +08:00
..
git-protect.list feat: add detailed instructions for creating and maintaining a blog, including protection for custom content 2025-05-27 11:38:02 +08:00
README-zh.md feat: add detailed instructions for creating and maintaining a blog, including protection for custom content 2025-05-27 11:38:02 +08:00
README.md feat: add detailed instructions for creating and maintaining a blog, including protection for custom content 2025-05-27 11:38:02 +08:00
sync-upstream.sh fix: translate sync-upstream.sh comments and usage instructions to English 2025-05-27 11:42:04 +08:00

🚀 Create and Maintain Your Own Blog Based on This Repository

This repository provides a visually polished blog template built with Astro and Retype, designed for seamless deployment and long-term maintenance. Follow the steps below to initialize your own blog and keep it in sync with future upstream updates.


Step 1: Create Your Own Repository

Do not fork this repository. Instead, click 👉 Use this template to create a new repository based on this template.

📌 Why not fork? Forked repositories are publicly visible by default, which may expose sensitive configuration data (e.g., deployment tokens, email addresses, API keys), posing a security risk.


✏️ Step 2: Safeguard Your Custom Content

Declare the files and directories you want to preserve in the scripts/git-protect.list file. This includes your posts, configuration files, and site-specific settings. These items will be automatically backed up and restored during synchronization with the upstream repository, ensuring they are never overwritten.


🌐 Step 3: Develop and Deploy Your Blog

  • Structure and write your content according to the projects directory layout.
  • Deploy the site using platforms such as Vercel or Netlify.
  • Continuous deployment via GitHub Actions is supported but optional.

🔄 Step 4: Sync with Upstream While Preserving Local Customizations

Before the first synchronization, add the upstream remote (only required once):

git remote add upstream https://github.com/radishzzz/astro-theme-retypeset.git

Then, run the sync script from the root directory of your repository:

chmod u+x scripts/sync-upstream.sh
bash scripts/sync-upstream.sh upstream/master /tmp/blog-sync

For Windows Users:

  • Use Git Bash to run the above commands;
  • Avoid using cmd.exe or PowerShell, as they may cause compatibility issues with file paths;
  • For best results, stick with Git Bash even on Windows.

📎 Frequently Asked Questions

  • Why not automate synchronization with GitHub Actions? Due to the active nature of this upstream repository, automatic merges are not guaranteed to be conflict-free. Manual review is often required.

  • Why are certain files protected? Upstream updates may introduce structural or styling changes. Defining protected files in git-protect.list ensures your custom content is preserved during synchronization.

  • Can I still sync if Ive modified the theme structure? Yes, but you'll need to manually resolve conflicts before syncing. Make sure all critical paths are properly listed in git-protect.list.