<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<title>21CSM</title>
	<subtitle>Writings by 21CSM</subtitle>
	<link rel="self" type="application/atom+xml" href="https://21csm.github.io/feed.xml"/>
  <link rel="alternate" type="text/html" href="https://21csm.github.io"/>
  
	<updated>2024-09-11T00:00:00+00:00</updated>
	
	<id>https://21csm.github.io/feed.xml</id>
	<entry xml:lang="en">
		<title>Publishing a Zola site to GitHub Pages with Nix and GitHub Actions</title>
		<published>2024-09-11T00:00:00+00:00</published>
		<updated>2024-09-11T00:00:00+00:00</updated>
		<link rel="alternate" type="text/html" href="https://21csm.github.io/blog/zola-github-pages/"/>
		<id>https://21csm.github.io/blog/zola-github-pages/</id>
    
		<content type="html" xml:base="https://21csm.github.io/blog/zola-github-pages/">&lt;p&gt;&lt;img src=&quot;https://21csm.github.io/blog/zola-github-pages/escher-banner.webp&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Escher, M.C. &lt;em&gt;Metamorphosis II&lt;/em&gt;. 1939-1940. Woodcut printed from 20 blocks on 3 combined sheets. National Gallery of Art, Washington, D.C.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This article is a bit &lt;em&gt;meta&lt;/em&gt;, but it explains how this blog is deployed and hosted. I use this setup because it&#39;s both powerful and convenient. Nix ensures that the site builds consistently on any machine. GitHub provides free hosting and automates the deployment process. Together, these tools make it easy to manage and update the site.&lt;/p&gt;
&lt;h2 id=&quot;what-is-zola&quot;&gt;What is Zola?&lt;a class=&quot;zola-anchor&quot; href=&quot;#what-is-zola&quot; aria-label=&quot;Anchor link for: what-is-zola&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://www.getzola.org/&quot;&gt;Zola&lt;/a&gt; is a fast, flexible static site generator written in Rust. It takes your content, applies templates, and generates a complete static website ready to be served.&lt;/p&gt;
&lt;h2 id=&quot;why-this-setup&quot;&gt;Why this Setup?&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-this-setup&quot; aria-label=&quot;Anchor link for: why-this-setup&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Consistent Environments&lt;/strong&gt;: Nix creates identical build environments on any machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automated Deployments&lt;/strong&gt;: GitHub Actions handle builds and deployments automatically.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Free Hosting&lt;/strong&gt;: GitHub Pages hosts your site at no cost.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version Control&lt;/strong&gt;: Your site&#39;s content is version-controlled with Git.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modularity&lt;/strong&gt;: Content, site generation, build process, and deployment are separate, easing maintenance.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;zola-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Anchor link for: prerequisites&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://nixos.org/download/&quot;&gt;Nix&lt;/a&gt; Installation (The package manager or NixOS)&lt;/li&gt;
&lt;li&gt;A &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt; Account&lt;/li&gt;
&lt;li&gt;Basic familiarity with &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://git-scm.com/&quot;&gt;Git&lt;/a&gt; and command-line operations&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;workflow&quot;&gt;Workflow&lt;a class=&quot;zola-anchor&quot; href=&quot;#workflow&quot; aria-label=&quot;Anchor link for: workflow&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;To better understand the entire process, let&#39;s look at a visual representation of the workflow:&lt;/p&gt;
&lt;pre class=&quot;mermaid&quot;&gt;

flowchart LR
    A[Local Development] --&gt; B[GitHub Repository]
    B --&gt; C[GitHub Actions]
    C --&gt; D[Build with Nix]
    D --&gt; E[Deploy to GitHub Pages]
    E --&gt; F[Site Live]

    A --&gt;|Push Changes| B
    C --&gt;|Triggered on Push| D

    style A fill:#f9d71c,stroke:#333,stroke-width:2px
    style C fill:#8da0cb,stroke:#333,stroke-width:2px
    style F fill:#66c2a5,stroke:#333,stroke-width:2px

&lt;/pre&gt;
&lt;p&gt;Now, let&#39;s walk through each step to get your site live.&lt;/p&gt;
&lt;h2 id=&quot;setup&quot;&gt;Setup&lt;a class=&quot;zola-anchor&quot; href=&quot;#setup&quot; aria-label=&quot;Anchor link for: setup&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;h3 id=&quot;1-scaffolding-a-zola-project&quot;&gt;1. Scaffolding a Zola project&lt;a class=&quot;zola-anchor&quot; href=&quot;#1-scaffolding-a-zola-project&quot; aria-label=&quot;Anchor link for: 1-scaffolding-a-zola-project&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;First, let&#39;s create a new Zola project:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;nix&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; shell&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; nixpkgs#zola&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-4&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-4&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; zola&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; my-zola-site&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-4&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; my-zola-site&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This command creates a new Zola project named &lt;code&gt;my-zola-site&lt;/code&gt;. The Zola CLI will ask you some setup questions. Don&#39;t worry too much about your choices; you can always change them later in &lt;code&gt;config.toml&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After setup, your project structure should look like this:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-4&quot;&gt;.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;├──&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; config.toml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;├──&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; content&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;├──&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; static&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;├──&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; templates&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;└──&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; themes&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To see your site locally, run:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;nix&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; shell&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; nixpkgs#zola&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-4&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-4&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; zola&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Visit the URL printed in your terminal (usually http://127.0.0.1:1111) to see your new Zola site:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://21csm.github.io/blog/zola-github-pages/zola-default-page.webp&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;blockquote class=&quot;markdown-alert-tip&quot;&gt;
&lt;p&gt;By default Zola will serve on &lt;code&gt;http://127.0.0.1:1111&lt;/code&gt;, but you can change the interface and port with the &lt;code&gt;--interface&lt;/code&gt; and &lt;code&gt;--port&lt;/code&gt; flags respectively.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;2-setting-up-a-nix-flake&quot;&gt;2. Setting up a Nix Flake&lt;a class=&quot;zola-anchor&quot; href=&quot;#2-setting-up-a-nix-flake&quot; aria-label=&quot;Anchor link for: 2-setting-up-a-nix-flake&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Create a file named &lt;code&gt;flake.nix&lt;/code&gt; in your project root with the following content:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;nix&quot; data-name=&quot;flake.nix&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 1&lt;/span&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 2&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;  description&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;Zola site built with Nix&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 4&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;  inputs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 5&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;    nixpkgs&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;github:NixOS/nixpkgs/nixos-unstable&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 6&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;    flake-utils&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;github:numtide/flake-utils&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 7&lt;/span&gt;&lt;span&gt;  }&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 9&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;  outputs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;span&gt; self&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;,&lt;/span&gt;&lt;span&gt; nixpkgs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;,&lt;/span&gt;&lt;span&gt; flake-utils&lt;/span&gt;&lt;span&gt; }&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;    flake-utils&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;eachDefaultSystem&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;system&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;      let&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;        pkgs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt; nixpkgs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;legacyPackages&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span&gt;${&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;system&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;      in&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;14&lt;/span&gt;&lt;span&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;        devShells&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt; pkgs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;mkShell&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;          buildInputs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span&gt; [&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt; pkgs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;zola&lt;/span&gt;&lt;span&gt; ]&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;17&lt;/span&gt;&lt;span&gt;        }&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;18&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;        packages&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;default&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt; pkgs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;stdenv&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;mkDerivation&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;          name&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;example&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-3&quot;&gt; #&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-3&quot;&gt; replace me&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;21&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;          src&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt; self&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;22&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;          buildInputs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span&gt; [&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt; pkgs&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-9 z-d-12&quot;&gt;zola&lt;/span&gt;&lt;span&gt; ]&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;23&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;          buildPhase&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;zola build&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;          installPhase&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; =&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;cp -r public $out&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;25&lt;/span&gt;&lt;span&gt;        }&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;26&lt;/span&gt;&lt;span&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;27&lt;/span&gt;&lt;span&gt;    )&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;28&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This flake defines both a development environment and a build process for your Zola site.&lt;/p&gt;
&lt;details&gt;
&lt;summary&gt;&lt;span&gt;Detailed Flake Summary&lt;/span&gt;&lt;/summary&gt;
&lt;p&gt;Let&#39;s break down the key parts of this Nix flake:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Description&lt;/strong&gt;: A brief description of the flake&#39;s purpose.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inputs&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nixpkgs&lt;/code&gt;: The main Nix packages repository.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;flake-utils&lt;/code&gt;: A utility library for writing flakes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Outputs&lt;/strong&gt;: This function defines what the flake produces.
&lt;ul&gt;
&lt;li&gt;It uses &lt;code&gt;flake-utils&lt;/code&gt; to generate outputs for each default system.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;devShells.default&lt;/code&gt;: Defines a development environment with Zola installed.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;packages.default&lt;/code&gt;: Defines how to build the Zola site:
&lt;ul&gt;
&lt;li&gt;Uses the flake&#39;s own directory as the source.&lt;/li&gt;
&lt;li&gt;Builds the site with &lt;code&gt;zola build&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Copies the &lt;code&gt;public&lt;/code&gt; directory to the output.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This setup allows for consistent development and build environments across different machines.&lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;To use the development environment:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;nix&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; develop&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see that you now enter a &lt;code&gt;bash&lt;/code&gt; environment. Now run:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;zola&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If this is successful, you will see the same output as we had above and should be able to navigate to the default Zola page.&lt;/p&gt;
&lt;p&gt;To build the site:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-d-7&quot;&gt;nix&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; build&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;3-github-actions&quot;&gt;3. GitHub Actions&lt;a class=&quot;zola-anchor&quot; href=&quot;#3-github-actions&quot; aria-label=&quot;Anchor link for: 3-github-actions&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Create a file at &lt;code&gt;.github/workflows/publish.yml&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;yaml&quot; data-name=&quot;.github/workflows/publish.yml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 1&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; P&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ublish&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 3&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-4&quot;&gt;on&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 4&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  p&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ush&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 5&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    b&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ranches&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; [&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ain&lt;/span&gt;&lt;span&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 6&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  w&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;orkflow_dispatch&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 7&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 8&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ermissions&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt; 9&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  c&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ontents&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ead&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  p&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ages&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; w&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;rite&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  i&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;d-token&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; w&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;rite&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  d&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;eployments&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; w&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;rite&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;13&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;j&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;obs&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  b&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;uild&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    r&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;uns-on&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; u&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;buntu-latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;17&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;teps&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;18&lt;/span&gt;&lt;span&gt;      -&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; C&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;heckout&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;19&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        u&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ses&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ctions/checkout@main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        w&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ith&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;21&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;          s&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ubmodules&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; r&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ecursive&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;22&lt;/span&gt;&lt;span&gt;      -&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; I&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;nstall Nix&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;23&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        u&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ses&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; D&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;eterminateSystems/nix-installer-action@main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;24&lt;/span&gt;&lt;span&gt;      -&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; R&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;un the Magic Nix Cache&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        u&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ses&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; D&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;eterminateSystems/magic-nix-cache-action@main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;26&lt;/span&gt;&lt;span&gt;      -&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; B&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;uild with Nix&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;27&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        r&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;un&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-10&quot;&gt; |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;28&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;          nix build &amp;#39;.?submodules=1#&amp;#39; &lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;29&lt;/span&gt;&lt;span&gt;      -&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; U&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;pload artifact&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        u&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ses&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ctions/upload-pages-artifact@main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        w&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ith&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;          p&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ath&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; .&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;/result&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;33&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;  d&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;eploy-production&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    e&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;nvironment&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;      n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; g&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ithub-pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;37&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;      u&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;rl&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;{{ steps.deployment.outputs.page_url }}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;38&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    r&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;uns-on&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; u&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;buntu-latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;39&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;eeds&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; b&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;uild&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    i&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;f&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; g&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ithub.ref == &amp;#39;refs/heads/main&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;41&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;    s&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;teps&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;42&lt;/span&gt;&lt;span&gt;      -&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt; n&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ame&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; D&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;eploy to GitHub Pages&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;43&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        i&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;d&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; d&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;eployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span aria-hidden=&quot;true&quot; class=&quot;giallo-ln&quot;&gt;44&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;        u&lt;/span&gt;&lt;span class=&quot;z-l-3 z-d-5&quot;&gt;ses&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-6&quot;&gt;ctions/deploy-pages@main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This workflow builds your site using Nix and deploys it to GitHub Pages whenever you push to the &lt;code&gt;main&lt;/code&gt; branch.&lt;/p&gt;
&lt;details&gt;
&lt;summary&gt;&lt;span&gt;Detailed GitHub Actions Summary&lt;/span&gt;&lt;/summary&gt;
&lt;p&gt;Let&#39;s break down the key components of this GitHub Actions workflow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Triggers&lt;/strong&gt;: The workflow runs on pushes to the &lt;code&gt;main&lt;/code&gt; branch and can be manually triggered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Permissions&lt;/strong&gt;: Sets necessary permissions for GitHub Pages deployment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Jobs&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;build&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Checks out the repository with submodules (important for themes).&lt;/li&gt;
&lt;li&gt;Installs Nix using a third-party action.&lt;/li&gt;
&lt;li&gt;Builds the site using our Nix configuration.&lt;/li&gt;
&lt;li&gt;Uploads the built site as an artifact.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;deploy&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Runs only after the build job succeeds.&lt;/li&gt;
&lt;li&gt;Deploys the built site to GitHub Pages.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/details&gt;
&lt;p&gt;This workflow automates the entire process from pushing changes to your repository to having those changes live on your site.&lt;/p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;Note the &lt;code&gt;submodules: recursive&lt;/code&gt; parameter in the checkout step and also the flag &lt;code&gt;&#39;.?submodules=1#&#39;&lt;/code&gt; passed in &lt;code&gt;nix build&lt;/code&gt;. This is crucial if you&#39;re using a Zola theme as a Git submodule, ensuring it&#39;s properly included in the build.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;4-github-pages&quot;&gt;4. GitHub Pages&lt;a class=&quot;zola-anchor&quot; href=&quot;#4-github-pages&quot; aria-label=&quot;Anchor link for: 4-github-pages&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;In your GitHub repository settings, under &quot;Pages&quot;, set the source to &quot;GitHub Actions&quot;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://21csm.github.io/blog/zola-github-pages/github-pages-settings.webp&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;
&lt;h2 id=&quot;deployment&quot;&gt;Deployment&lt;a class=&quot;zola-anchor&quot; href=&quot;#deployment&quot; aria-label=&quot;Anchor link for: deployment&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;To deploy your site:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Commit your changes&lt;/li&gt;
&lt;li&gt;Push to your GitHub repository&lt;/li&gt;
&lt;li&gt;GitHub Actions will automatically build and deploy your site&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can monitor the deployment in the &quot;Actions&quot; tab of your GitHub repository.&lt;/p&gt;
&lt;h2 id=&quot;customization&quot;&gt;Customization&lt;a class=&quot;zola-anchor&quot; href=&quot;#customization&quot; aria-label=&quot;Anchor link for: customization&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;To customize your Zola site:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Theme&lt;/strong&gt;: Choose a theme from the &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://www.getzola.org/themes/&quot;&gt;Zola themes gallery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration&lt;/strong&gt;: Edit &lt;code&gt;config.toml&lt;/code&gt; for site-wide settings&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content&lt;/strong&gt;: Add Markdown files to the &lt;code&gt;content&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Templates&lt;/strong&gt;: Customize HTML structure in the &lt;code&gt;templates&lt;/code&gt; directory&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Static Files&lt;/strong&gt;: Add images, CSS, or JavaScript to the &lt;code&gt;static&lt;/code&gt; directory&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Always test changes locally with &lt;code&gt;zola serve&lt;/code&gt; before pushing to GitHub.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;a class=&quot;zola-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Anchor link for: conclusion&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;You now have a Zola site that automatically builds and deploys to GitHub Pages using Nix and GitHub Actions. This setup provides reproducible builds, automated deployments, and free hosting.&lt;/p&gt;
&lt;p&gt;The &lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://github.com/21CSM/21csm.github.io&quot;&gt;source code for this site&lt;/a&gt; can serve as a reference for your own projects.&lt;/p&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further Reading&lt;a class=&quot;zola-anchor&quot; href=&quot;#further-reading&quot; aria-label=&quot;Anchor link for: further-reading&quot; style=&quot;visibility: hidden;&quot;&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://www.getzola.org/documentation/getting-started/overview/&quot;&gt;Zola Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://nix.dev/manual/nix/stable/&quot;&gt;Nix Manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://docs.github.com/en/actions&quot;&gt;GitHub Actions Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://www.markdownguide.org/&quot;&gt;Markdown Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow noreferrer external&quot; href=&quot;https://keats.github.io/tera/&quot;&gt;Learn Tera Templating&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
	</entry>
</feed>
