<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>GitHub | TZstats Convergence Lab | Tian Zheng, Columbia Stats</title><link>https://sites.stat.columbia.edu/tzheng/tags/github/</link><atom:link href="https://sites.stat.columbia.edu/tzheng/tags/github/index.xml" rel="self" type="application/rss+xml"/><description>GitHub</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Mon, 01 Jun 2026 00:00:00 +0000</lastBuildDate><image><url>https://sites.stat.columbia.edu/tzheng/media/icon_hu_244c03810a53b12e.png</url><title>GitHub</title><link>https://sites.stat.columbia.edu/tzheng/tags/github/</link></image><item><title>Keeping Two Sites in Sync: My Hugo + VS Code + Copilot Workflow</title><link>https://sites.stat.columbia.edu/tzheng/post/2026-06-01-website-workflows/</link><pubDate>Mon, 01 Jun 2026 00:00:00 +0000</pubDate><guid>https://sites.stat.columbia.edu/tzheng/post/2026-06-01-website-workflows/</guid><description>&lt;p&gt;&lt;strong&gt;Story: How I Got Here&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This setup lets me iterate quickly on a GitHub mirror while publishing the official version on my university domain.&lt;/p&gt;
&lt;p&gt;In summer 2025, after nearly ten years of intensive administrative work, I finally returned to updating my website. I hit a wall quickly: the Hugo template I had used years ago was no longer compatible with current versions, and the ecosystem had changed significantly.&lt;/p&gt;
&lt;p&gt;I had two choices: (1) keep patching and debugging the old setup (which I tried for hours), or (2) rebuild cleanly. Starting over is usually not my style, but this time it was the right call.&lt;/p&gt;
&lt;p&gt;I started with &lt;a href="https://hugoblox.com/" target="_blank" rel="noopener"&gt;Hugoblox&lt;/a&gt;, which gave me a working site and GitHub deployment pipeline right away. Since I already maintain a university-hosted site, I kept that as the official destination instead of moving entirely to GitHub Pages.&lt;/p&gt;
&lt;p&gt;I cloned the source repo with GitHub Desktop and updated my Hugo settings for two contexts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;default GitHub-friendly settings (for the mirror site), and&lt;/li&gt;
&lt;li&gt;local deployment settings (for my university server workflow).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this repo, those settings live in Hugo YAML config files (for example, &lt;code&gt;config/_default/hugo.yaml&lt;/code&gt; and &lt;code&gt;config/local/hugo.yaml&lt;/code&gt;), not in a single &lt;code&gt;config.yaml&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;I now manage this workflow in VS Code, with GitHub Copilot helping me check config details, draft content updates, and keep the dual-site setup consistent.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dual-Site Setup&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I now maintain two related outputs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A GitHub mirror site for easy preview and sharing.&lt;/li&gt;
&lt;li&gt;My official university-hosted site for the final public version.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This gives me fast iteration plus institutional hosting when I am ready to publish.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Folder &amp;amp; Project Structure&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WebsiteProjectFolder/ (main local project folder)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;|- public/ (local Hugo build output)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;|- GitHubRepo/ -&amp;gt; [Alias/Symlink] -------+
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GitHubLocalRepos/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;|- HugoSourceRepo/ (actual Git clone)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |- config/
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | |- _default/hugo.yaml (default/GitHub-oriented settings)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; | |- local/hugo.yaml (local university deployment settings)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |- content/ (Markdown content)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |- layouts/ (site templates)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |- static/ (static assets)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |- ...
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;The alias/symlink inside &lt;code&gt;WebsiteProjectFolder/&lt;/code&gt; points to the real Git clone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;public/&lt;/code&gt; stays outside the source repo, so build output is cleanly separated from version-controlled source files.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Current Development Workflow&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I used to manually comment/uncomment &lt;code&gt;publishDir&lt;/code&gt; to avoid breaking GitHub builds. A cleaner approach is to keep local overrides in &lt;code&gt;config/local/hugo.yaml&lt;/code&gt; and apply them only for local builds.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Edit in VS Code]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo server (local preview)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Commit + push (GitHub Desktop)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GitHub mirror updates
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; |
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; v
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;When ready: sync local public/ -&amp;gt; university public_html/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This avoids repeatedly editing tracked defaults.&lt;/p&gt;
&lt;p&gt;Example commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Local preview with local overrides&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo server --config config/_default/hugo.yaml,config/local/hugo.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Default build (GitHub-oriented defaults only)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hugo
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;VPN + Cyberduck Deployment Workflow&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Connect to university VPN.&lt;/li&gt;
&lt;li&gt;Open Cyberduck and mount the university server.&lt;/li&gt;
&lt;li&gt;Sync local &lt;code&gt;public/&lt;/code&gt; to server &lt;code&gt;public_html/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Review changes before sync for extra safety.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Copilot in This Workflow&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;VS Code + Copilot has been genuinely useful for maintaining this setup. In practice, it helps me:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;check Hugo config consistency across files,&lt;/li&gt;
&lt;li&gt;polish post drafts and fix markdown formatting,&lt;/li&gt;
&lt;li&gt;troubleshoot command-line and deployment steps,&lt;/li&gt;
&lt;li&gt;keep documentation aligned with what I actually run.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It does not replace understanding the system, but it significantly reduces friction.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why This Setup Works for Me&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Many colleagues use GitHub Pages or WordPress very effectively. Those are great options. For my needs, this Hugo + GitHub mirror + university deployment model offers the right balance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reproducible source-managed content,&lt;/li&gt;
&lt;li&gt;a fast, shareable mirror for feedback,&lt;/li&gt;
&lt;li&gt;and an official university-hosted site for final publication.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At this stage, the system feels stable and sustainable, and day-to-day maintenance is much smoother.&lt;/p&gt;</description></item></channel></rss>