<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Publishing on brege.org</title>
    <link>https://brege.org/tags/publishing/</link>
    <description>Recent content in Publishing on brege.org</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>Copyright (c) 2016-2026 Wyatt Brege</copyright>
    <lastBuildDate>Sun, 12 Apr 2026 21:44:40 -0400</lastBuildDate>
    <atom:link href="https://brege.org/tags/publishing/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>New way forward for deploying brege.org</title>
      <link>https://brege.org/post/new-way-forward-for-deploying-brege.org/</link>
      <pubDate>Tue, 18 Oct 2016 16:35:01 -0700</pubDate>
      <guid>https://brege.org/post/new-way-forward-for-deploying-brege.org/</guid>
      <description>&lt;p&gt;ssh&amp;rsquo;ing into my Digital Ocean droplet has become rather annoying for maintaining this website.  Particularly annoying is dealing with images on two different filesystems.  In the &lt;a href=&#34;https://github.com/brege/brege.org/blob/master/README.md&#34;&gt;README&lt;/a&gt; (commit &lt;a href=&#34;https://github.com/brege/brege.org/commit/1a0ee5a1a946bf5ee574a4593e4e6b22d35607e3&#34;&gt;1a0ee5a&lt;/a&gt;), I describe the steps I have been doing to publish an article to &lt;a href=&#34;https://brege.org&#34;&gt;https://brege.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I tried implementing &lt;a href=&#34;https://www.digitalocean.com/community/tutorials/how-to-deploy-a-hugo-site-to-production-with-git-hooks-on-ubuntu-14-04&#34;&gt;this method&lt;/a&gt;, but it is very long and requires many modifications to the post-receive hook to get it working on a per-user basis.&lt;/p&gt;
&lt;p&gt;Here I outline a way to do this in a more conservative manner.&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>ssh&rsquo;ing into my Digital Ocean droplet has become rather annoying for maintaining this website.  Particularly annoying is dealing with images on two different filesystems.  In the <a href="https://github.com/brege/brege.org/blob/master/README.md">README</a> (commit <a href="https://github.com/brege/brege.org/commit/1a0ee5a1a946bf5ee574a4593e4e6b22d35607e3">1a0ee5a</a>), I describe the steps I have been doing to publish an article to <a href="https://brege.org">https://brege.org</a>.</p>
<p>I tried implementing <a href="https://www.digitalocean.com/community/tutorials/how-to-deploy-a-hugo-site-to-production-with-git-hooks-on-ubuntu-14-04">this method</a>, but it is very long and requires many modifications to the post-receive hook to get it working on a per-user basis.</p>
<p>Here I outline a way to do this in a more conservative manner.</p>
<h2 id="installation-on-development-machine">Installation on development machine</h2>
<ol>
<li>On a development laptop, <a href="https://getfedora.org/">Fedora</a>, I installed <a href="https://golang.org/">Go</a> and <a href="https://gohugo.io">Hugo</a> via</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo dnf install golang
</span></span><span class="line"><span class="cl">mkdir -p ~/build/go
</span></span><span class="line"><span class="cl"><span class="nb">export</span> <span class="nv">GOPATH</span><span class="o">=</span><span class="nv">$HOME</span>/build/go
</span></span><span class="line"><span class="cl">go get -v github.com/spf13/hugo
</span></span></code></pre></div><ol start="2">
<li>Clone repository</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">cd</span> ~/build/
</span></span><span class="line"><span class="cl">git clone git://github.com/brege/brege.org.git
</span></span></code></pre></div><h2 id="new-workflow-for-publishing-an-article">New workflow for publishing an article</h2>
<ol>
<li>I once again use Hugo to create my article</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">cd</span> ~/build/brege.org
</span></span><span class="line"><span class="cl">hugo new post/new-way-forward-for-deploying-brege.org.md
</span></span></code></pre></div><ol start="2">
<li>
<p>Add content, run <code>hugo server</code>, then preview http://localhost:1313 in a browser to determine what needs to be edited.  The cool thing about this is you can edit/add a file while the test server is running. You don&rsquo;t even need to refresh the browser page whenever you save the file!</p>
</li>
<li>
<p>Run <code>rm -r public/ ; hugo</code> to remove the old and create the new <code>public/</code> directory on the development machine.</p>
</li>
<li>
<p>Ship the changes to the production server (DO droplet) with rsync:</p>
</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">rsync -avP --delete --exclude<span class="o">=</span><span class="s2">&#34;.well-known&#34;</span> public/ brege.org:/usr/share/nginx/brege.org/
</span></span></code></pre></div><p>The new article will now show up on the <a href="https://brege.org/post/new-way-forward-for-deploying-brege/">https://brege.org/post/new-way-forward-for-deploying-brege/</a></p>
<ol start="5">
<li>Finally, commit the new article to GitHub:</li>
</ol>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git add content/post/new-way-forward-for-deploying-brege.org.md
</span></span><span class="line"><span class="cl">git commit -m <span class="s2">&#34;Add article&#34;</span>
</span></span><span class="line"><span class="cl">git push -u origin master
</span></span></code></pre></div><p>Much nicer way to go about it.  Images and other assets can be more readily copied and modified.  I can edit a webpage on the fly before publishing layout-bugs and typos to the world (or, at least to a lesser extent).</p>]]></content:encoded>
    </item>
  </channel>
</rss>
