<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Scc_hy</title>
    <description>The latest articles on DEV Community by Scc_hy (@scchy).</description>
    <link>https://dev.to/scchy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4059119%2F44320eda-f8f5-4276-b7b5-e10351b263a8.jpg</url>
      <title>DEV Community: Scc_hy</title>
      <link>https://dev.to/scchy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/scchy"/>
    <language>en</language>
    <item>
      <title>Building a Self-Hosted Developer Blog with Astro: The Complete Guide</title>
      <dc:creator>Scc_hy</dc:creator>
      <pubDate>Sun, 02 Aug 2026 15:09:35 +0000</pubDate>
      <link>https://dev.to/scchy/di-pian-yong-astro-da-jian-ge-ren-kai-fa-zhe-bo-ke-wan-zheng-guo-cheng--1mf9</link>
      <guid>https://dev.to/scchy/di-pian-yong-astro-da-jian-ge-ren-kai-fa-zhe-bo-ke-wan-zheng-guo-cheng--1mf9</guid>
      <description>&lt;h2&gt;
  
  
  Why I Started a Blog
&lt;/h2&gt;

&lt;p&gt;As a developer, &lt;strong&gt;writing things down and sharing them is the best way to learn&lt;/strong&gt;. But &lt;em&gt;where&lt;/em&gt; you write and &lt;em&gt;how&lt;/em&gt; you organize it determines whether your content can compound in value over the long term.&lt;/p&gt;

&lt;p&gt;After comparing platforms like WeChat Official Accounts, Zhihu, and Juejin, I ultimately chose a &lt;strong&gt;self-hosted blog as my home base&lt;/strong&gt;. Three core reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Full content ownership&lt;/strong&gt;: Not subject to platform algorithms, bans, redesigns, or commercialization&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long-term SEO compounding&lt;/strong&gt;: Valuable content keeps earning organic search traffic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero server cost&lt;/strong&gt;: GitHub Pages hosts for free, paired with Astro to generate a purely static site&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Dual-Track Content Strategy
&lt;/h2&gt;

&lt;p&gt;This is the core methodology behind this blog — a &lt;strong&gt;"self-hosted home base + community distribution"&lt;/strong&gt; dual-track model:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Track&lt;/th&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Advantage&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Home base&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;This site (Astro)&lt;/td&gt;
&lt;td&gt;Compounding SEO &amp;amp; long-term content&lt;/td&gt;
&lt;td&gt;Content ownership, SEO accumulation, portability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Distribution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dev.to, Juejin&lt;/td&gt;
&lt;td&gt;Immediate feedback &amp;amp; traffic&lt;/td&gt;
&lt;td&gt;Community exposure, fast interaction, cold-start&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Key principle: canonical URL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every article distributed to communities must point back to the original on this site via &lt;code&gt;canonical_url&lt;/code&gt;, to avoid search engines flagging duplicate content. This way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communities drive immediate traffic&lt;/li&gt;
&lt;li&gt;Search engine authority eventually accrues to this site&lt;/li&gt;
&lt;li&gt;Even if a platform changes, the content asset is never lost&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tech Selection: Why Astro
&lt;/h2&gt;

&lt;p&gt;Comparing several mainstream static site options:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Pros&lt;/th&gt;
&lt;th&gt;Cons&lt;/th&gt;
&lt;th&gt;Best For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Astro&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Zero JS by default, Islands architecture, extreme performance, native MDX&lt;/td&gt;
&lt;td&gt;Relatively young ecosystem&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Content sites (blogs)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Next.js&lt;/td&gt;
&lt;td&gt;Powerful, React ecosystem&lt;/td&gt;
&lt;td&gt;Heavy, slower builds&lt;/td&gt;
&lt;td&gt;Complex applications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hexo / Jekyll&lt;/td&gt;
&lt;td&gt;Many themes, mature ecosystem&lt;/td&gt;
&lt;td&gt;Less flexible&lt;/td&gt;
&lt;td&gt;Traditional blogs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hugo&lt;/td&gt;
&lt;td&gt;Extremely fast builds&lt;/td&gt;
&lt;td&gt;Go template learning curve&lt;/td&gt;
&lt;td&gt;Large documentation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Several Astro features make it especially well-suited for blogging:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero JS by default&lt;/strong&gt;: pages load no JavaScript by default, blazing-fast first paint&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Islands architecture&lt;/strong&gt;: loads JS only where interaction is needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Native Markdown / MDX support&lt;/strong&gt;: writing a post is just writing Markdown&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Collections&lt;/strong&gt;: built-in type-safe content management&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architecture Design
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────┐   git push   ┌─────────────────────┐   build &amp;amp; deploy   ┌─────────────────┐
│   Local Markdown│ ────────────► │  GitHub Repository  │ ──────────────────► │   GitHub Pages  │
│  (src/content)  │              │  (scc-blog)         │                     │   (static site) │
└─────────────────┘              └─────────────────────┘                     └─────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tech stack&lt;/strong&gt;: Astro + Node.js 22 + GitHub Actions + GitHub Pages&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;src/content/blog/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Markdown article storage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;astro.config.mjs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Astro config (site, base, integrations)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;GitHub Actions auto build &amp;amp; deploy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;public/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Static assets (favicon, robots.txt, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dist/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Build output directory&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  The Complete Setup Process
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Initialize the Astro project
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# In your project directory&lt;/span&gt;
npm create astro@latest scc-blog &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--template&lt;/span&gt; blog &lt;span class="nt"&gt;--no-install&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;scc-blog
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates the official Astro blog template with the homepage, article list, article detail page, BaseHead component, and other basic structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Configure GitHub Pages deployment
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy to GitHub Pages&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;main&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;
  &lt;span class="na"&gt;pages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
  &lt;span class="na"&gt;id-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;22&lt;/span&gt;
          &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm run build&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/upload-pages-artifact@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./dist&lt;/span&gt;

  &lt;span class="na"&gt;deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;needs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github-pages&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.deployment.outputs.page_url }}&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/deploy-pages@v4&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deployment&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure &lt;code&gt;astro.config.mjs&lt;/code&gt; for the GitHub Pages subpath:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;site&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://scchy.github.io&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/scc-blog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;integrations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;mdx&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nf"&gt;sitemap&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;site&lt;/code&gt; is the GitHub Pages domain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;base&lt;/code&gt; must be the repo name, since a project site lives at &lt;code&gt;https://scchy.github.io/scc-blog/&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Localize content and site info
&lt;/h3&gt;

&lt;p&gt;Convert the default English template to Chinese:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// src/consts.ts&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SITE_TITLE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SCC 的博客&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SITE_DESCRIPTION&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;记录技术、思考与成长的开发者博客&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set the homepage &lt;code&gt;lang&lt;/code&gt; to &lt;code&gt;zh-CN&lt;/code&gt;, translate the Hero copy, and add a &lt;code&gt;canonical_url&lt;/code&gt; field to article frontmatter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Add README and writing workflow
&lt;/h3&gt;

&lt;p&gt;The README documents local development, the writing workflow, deploy URL, and the content distribution strategy, making future maintenance (and possible collaboration) easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Connect the remote and push
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin https://github.com/scchy/scc-blog.git
git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After pushing to &lt;code&gt;main&lt;/code&gt;, GitHub Actions automatically triggers the build and deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Flow
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Author creates a new Markdown file under &lt;code&gt;src/content/blog/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Fill in the Frontmatter (title, description, pubDate, tags, canonical_url)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git commit&lt;/code&gt; + &lt;code&gt;git push&lt;/code&gt; to the main branch&lt;/li&gt;
&lt;li&gt;GitHub Actions triggers: checkout → setup-node → npm ci → build → deploy-pages&lt;/li&gt;
&lt;li&gt;GitHub Pages serves the static files from &lt;code&gt;dist/&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Real Pitfalls Encountered
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. GitHub username mismatch
&lt;/h3&gt;

&lt;p&gt;Initially configured with &lt;code&gt;scc.github.io&lt;/code&gt;, but the actual GitHub account is &lt;code&gt;scchy&lt;/code&gt;. This caused:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;site&lt;/code&gt; and &lt;code&gt;base&lt;/code&gt; in &lt;code&gt;astro.config.mjs&lt;/code&gt; needed correcting to &lt;code&gt;scchy.github.io&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;canonical_url&lt;/code&gt; in the README and articles needed updating too&lt;/li&gt;
&lt;li&gt;The git remote also had to change to &lt;code&gt;github.com/scchy/scc-blog.git&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Lesson&lt;/strong&gt;: confirm your GitHub username before starting; manage all URLs with placeholders to avoid scattering them around.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. GitHub Pages 404
&lt;/h3&gt;

&lt;p&gt;The first visit to &lt;code&gt;https://scchy.github.io/scc-blog/&lt;/code&gt; returned 404. Troubleshooting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The GitHub Actions workflow may have failed&lt;/li&gt;
&lt;li&gt;Pages &lt;strong&gt;Source must be &lt;code&gt;GitHub Actions&lt;/code&gt;&lt;/strong&gt;, not &lt;code&gt;Deploy from a branch&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;First deployment has a delay; wait 5–10 minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Unstable push network
&lt;/h3&gt;

&lt;p&gt;Local &lt;code&gt;git commit&lt;/code&gt; succeeded, but &lt;code&gt;git push&lt;/code&gt; failed multiple times due to network flakiness. Solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retry multiple times with a tokenized remote URL&lt;/li&gt;
&lt;li&gt;Reset the remote to a clean URL (no token) immediately after a successful push&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. SEO details added later
&lt;/h3&gt;

&lt;p&gt;After setup, I added SEO-related files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;public/robots.txt&lt;/code&gt;: allow search engines to crawl, declare the sitemap&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/pages/rss.xml.js&lt;/code&gt;: generate an RSS feed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;BaseHead.astro&lt;/code&gt;: fix OG image URLs, add RSS auto-discovery&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Blog Evolution &amp;amp; Current State
&lt;/h2&gt;

&lt;p&gt;After the initial build, the blog went through several more iterations. Current features include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dante theme&lt;/strong&gt;: migrated from the default blog template to the Dante theme — blog + portfolio in one, with dark mode and View Transitions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;5 topic categories&lt;/strong&gt;: Reinforcement Learning, LLM + Agent, ML &amp;amp; Deep Learning, Parenting &amp;amp; Growth, Experience Sharing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reading time &amp;amp; TOC&lt;/strong&gt;: auto-estimated reading duration and a jumpable table of contents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RSS &amp;amp; Sitemap&lt;/strong&gt;: auto-generated RSS feed and site map&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Search Console&lt;/strong&gt;: verified the domain and submitted the sitemap, with indexing monitoring&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO optimization&lt;/strong&gt;: Open Graph, Twitter Card, canonical URL, robots.txt&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-platform distribution (bilingual)&lt;/strong&gt;: every post is maintained in both Chinese and English, auto-synced via GitHub Actions — Chinese goes to this site + Juejin (as draft), English goes to Dev.to (published directly), all with canonical URLs pointing back here to avoid SEO duplication&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comments (Giscus)&lt;/strong&gt;: a lightweight comment system built on GitHub Discussions — free, no ads, Chinese-friendly, and you own the comment data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Multi-Platform Distribution Architecture
&lt;/h2&gt;

&lt;p&gt;Content follows the &lt;strong&gt;"self-hosted home base + community distribution"&lt;/strong&gt; dual-track strategy, partially automated through GitHub Actions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        ┌──────────────────────────────────────────────┐
        │           src/content/blog/                   │
        │  first-post.md (Chinese)  first-post.en.md (English) │
        └──────────────────────────────────────────────┘
                          │ git push
                          ▼
              ┌───────────────────────┐
              │   GitHub Actions       │
              └───────────────────────┘
            ┌───────────┼───────────┐
            ▼           ▼           ▼
      ┌──────────┐ ┌─────────┐ ┌─────────┐
      │ This site │ │ Juejin  │ │ Dev.to  │
      │ (Chinese) │ │(Chinese)│ │(English)│
      │ auto-deploy│ │ draft   │ │ published│
      └──────────┘ └─────────┘ └─────────┘
          all with canonical_url pointing back here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Distribution rules&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;This site&lt;/strong&gt;: deploys the Chinese version (&lt;code&gt;.md&lt;/code&gt;); the English version (&lt;code&gt;.en.md&lt;/code&gt;) is excluded from the content collection so it doesn't generate a page&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Juejin&lt;/strong&gt;: syncs the Chinese version (&lt;code&gt;.md&lt;/code&gt;) as a &lt;strong&gt;draft&lt;/strong&gt;, published manually by the author in the backend (avoids platform risk-control against AI-batch-published content)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dev.to&lt;/strong&gt;: syncs the English version (&lt;code&gt;.en.md&lt;/code&gt;) and &lt;strong&gt;publishes it directly&lt;/strong&gt; (Dev.to has an official API, fully automated)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key technical points&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Juejin has no official public API; it's accessed via its web &lt;code&gt;api.juejin.cn&lt;/code&gt; endpoints + login cookie (same source as community MCP solutions)&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;curl&lt;/code&gt; instead of Node &lt;code&gt;fetch&lt;/code&gt; for cookie-bearing requests — &lt;code&gt;fetch&lt;/code&gt; handles cookies with special characters unreliably&lt;/li&gt;
&lt;li&gt;Juejin's draft-list endpoint is unavailable, so matching is done against &lt;strong&gt;published articles&lt;/strong&gt;: update if published, otherwise create a new draft&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Comments (Giscus)
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Giscus&lt;/strong&gt; comment system at the bottom of each post was chosen after comparing several options:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Option&lt;/th&gt;
&lt;th&gt;Data Ownership&lt;/th&gt;
&lt;th&gt;Ads&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;th&gt;Chinese Support&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Giscus&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yours (GitHub Discussions)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;utterances&lt;/td&gt;
&lt;td&gt;Yours (GitHub Issues)&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Waline/Twikoo&lt;/td&gt;
&lt;td&gt;Third-party backend&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Needs backend&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Disqus&lt;/td&gt;
&lt;td&gt;Third-party&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Free/Paid&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Why Giscus&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comment data lives in GitHub Discussions — &lt;strong&gt;you own it&lt;/strong&gt;, consistent with this blog's "content ownership" philosophy&lt;/li&gt;
&lt;li&gt;No extra server or database needed; it's a lightweight front-end script that doesn't hurt performance&lt;/li&gt;
&lt;li&gt;Chinese UI, and readers comment with their GitHub account&lt;/li&gt;
&lt;li&gt;Automatically follows the blog's dark mode&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Keep writing — at least one post per week&lt;/li&gt;
&lt;li&gt;Add real portfolio projects&lt;/li&gt;
&lt;li&gt;Consider a custom domain&lt;/li&gt;
&lt;li&gt;Improve Juejin distribution: semi-automate the draft publishing flow&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This blog documents my thinking on technology, products, and personal growth. Feel free to stop by.&lt;/p&gt;

</description>
      <category>astro</category>
      <category>githubpages</category>
      <category>seo</category>
      <category>blogging</category>
    </item>
  </channel>
</rss>
