<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Blogging on Noetic Nought</title>
    <link>https://punchagan.muse-amuse.in/tags/blogging/</link>
    <description>Recent content in Blogging on Noetic Nought</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>© 2006-2026 CC-BY-SA-4.0</copyright>
    <lastBuildDate>Sun, 31 May 2020 17:19:00 +0530</lastBuildDate>
    <atom:link href="https://punchagan.muse-amuse.in/tags/blogging/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Deploying Hugo Drafts, simplified</title>
      <link>https://punchagan.muse-amuse.in/blog/deploying-hugo-drafts-simplified/</link>
      <pubDate>Sun, 31 May 2020 17:19:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/deploying-hugo-drafts-simplified/</guid>
      <description>&lt;p&gt;This is a follow-up post to my last post, &lt;a href=&#34;https://punchagan.muse-amuse.in/blog/deploying-hugo-drafts&#34;&gt;Deploying Hugo Drafts&lt;/a&gt;. Kaushal Modi,&#xA;the author of &lt;a href=&#34;https://github.com/kaushalmodi/ox-hugo&#34;&gt;ox-hugo&lt;/a&gt; (a tool that lets you compose in org-mode and use Hugo to&#xA;export), let me know about the &lt;a href=&#34;https://gohugo.io/content-management/build-options/&#34;&gt;build options&lt;/a&gt; in Hugo.&lt;/p&gt;&#xA;&lt;blockquote class=&#34;twitter-tweet&#34;&gt;&lt;p lang=&#34;en&#34; dir=&#34;ltr&#34;&gt;Have you looked at the new _build options: &lt;a href=&#34;https://t.co/Nj8Uefis6Q&#34;&gt;https://t.co/Nj8Uefis6Q&lt;/a&gt;. I haven&amp;#39;t used them yet, but looks like they fit your use case.&lt;/p&gt;&amp;mdash; Kaushal (@kaushalmodi) &lt;a href=&#34;https://twitter.com/kaushalmodi/status/1266761525286653952?ref_src=twsrc%5Etfw&#34;&gt;May 30, 2020&lt;/a&gt;&lt;/blockquote&gt;&#xA;&lt;script async src=&#34;https://platform.twitter.com/widgets.js&#34; charset=&#34;utf-8&#34;&gt;&lt;/script&gt;&#xA;&#xA;&#xA;&lt;p&gt;The build options in Hugo let you configure building a post for different use&#xA;cases like render a post but hide it in lists, or don&amp;rsquo;t render separate pages&#xA;for posts and only show them in lists, etc.&lt;/p&gt;&#xA;&lt;p&gt;To use these build options for my use case &amp;ndash; being able to share draft post&#xA;links with friends, without them appearing in the index page or RSS feed &amp;ndash; I&#xA;just need to add the following to my draft blog posts!&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;_build&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;render&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But, how do I do this with &lt;code&gt;ox-hugo&lt;/code&gt;? I know &lt;code&gt;ox-hugo&lt;/code&gt; doesn&amp;rsquo;t yet have this&#xA;feature, for sure, because Kaushal mentioned that he hasn&amp;rsquo;t tried it out yet.&lt;/p&gt;&#xA;&lt;p&gt;I checked to see if I could use the &lt;code&gt;EXPORT_HUGO_CUSTOM_FRONT_MATTER&lt;/code&gt; property&#xA;to get it to generate this extra metadata for each blog post. But that didn&amp;rsquo;t&#xA;work. The property assumes all the arguments to it are top level front matter&#xA;keys and values, which is good enough for &amp;ldquo;normal&amp;rdquo; use cases.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDIT &lt;span class=&#34;timestamp-wrapper&#34;&gt;&lt;span class=&#34;timestamp&#34;&gt;[2020-05-31 Sun]&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;: I previously manually created the &lt;code&gt;drafts&lt;/code&gt; directory with&#xA;the &lt;code&gt;_index.md&lt;/code&gt;, but Kaushal pointed me to &lt;a href=&#34;https://twitter.com/kaushalmodi/status/1267066389996724229&#34;&gt;more docs&lt;/a&gt;, again! :) There&amp;rsquo;s also an&#xA;&lt;a href=&#34;https://github.com/kaushalmodi/ox-hugo/issues/358&#34;&gt;issue&lt;/a&gt; for adding an easier way to add these build options from ox-hugo.&lt;/p&gt;&#xA;&lt;p&gt;I created a subtree like this in my org file, that creates the&#xA;&lt;code&gt;drafts/_index.md&lt;/code&gt; file with the required front matter and build options.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-org&#34; data-lang=&#34;org&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;gs&#34;&gt; Drafts&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;:PROPERTIES:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;&lt;/span&gt;&lt;span class=&#34;cs&#34;&gt;:EXPORT_FILE_NAME: _index&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;:EXPORT_HUGO_SECTION: drafts&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;:EXPORT_HUGO_CUSTOM_FRONT_MATTER: yaml&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;:END:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;#+begin_src &lt;/span&gt;&lt;span class=&#34;cs&#34;&gt;yaml&lt;/span&gt;&lt;span class=&#34;c&#34;&gt; :front_matter_extra t&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;_build&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;render&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;publishResources&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;cascade&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;_build&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;render&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;#+end_src&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The build options for the index page turn off publishing and showing it in&#xA;lists. With the &lt;code&gt;cascade&lt;/code&gt; option, we can get the options to all the children &amp;ndash;&#xA;any files created in the &lt;code&gt;drafts&lt;/code&gt; directory, but also override the &lt;code&gt;render&lt;/code&gt;&#xA;option to be true. In other words, the configuration above would translate to&#xA;adding the following to &lt;em&gt;every draft post&lt;/em&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-toml&#34; data-lang=&#34;toml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;A&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;How-to&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;on&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Hugo&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Drafts&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;_build&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;render&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;publishResources&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;list&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, I just need to make sure that all my draft posts are created in this&#xA;&lt;code&gt;drafts&lt;/code&gt; directory. &lt;code&gt;ox-hugo&lt;/code&gt; allows doing this by simply using the&#xA;&lt;code&gt;EXPORT_HUGO_SECTION&lt;/code&gt; property on my post subtree. I added this additional&#xA;property to my helper function that I use to create hugo blog posts from any&#xA;subtree.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-org&#34; data-lang=&#34;org&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;gs&#34;&gt; DRAFT A How-to on Hugo Drafts&lt;/span&gt;&lt;span class=&#34;ge&#34;&gt; :blogging:hack:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;:PROPERTIES:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;&lt;/span&gt;&lt;span class=&#34;cs&#34;&gt;:EXPORT_FILE_NAME: how-to-hugo-drafts&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;:EXPORT_HUGO_SECTION: drafts&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;:EXPORT_DATE: [2020-05-31 Sun 16:51]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cs&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c&#34;&gt;:END:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;m now all set to publish draft posts without requiring to use &lt;code&gt;rsync&lt;/code&gt; and two&#xA;&lt;code&gt;hugo&lt;/code&gt; builds. :) Publishing a draft post would need me to remove the &lt;code&gt;DRAFT&lt;/code&gt;&#xA;todo keyword, like before, but additionally also remove the&#xA;&lt;code&gt;:EXPORT_HUGO_SECTION:&lt;/code&gt; property on the subtree. This should be quite quick to&#xA;do, or pretty easy to put into an interactive function if required.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Deploying Hugo Drafts</title>
      <link>https://punchagan.muse-amuse.in/blog/deploying-hugo-drafts/</link>
      <pubDate>Sat, 30 May 2020 19:07:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/deploying-hugo-drafts/</guid>
      <description>&lt;p&gt;&lt;strong&gt;Update &lt;span class=&#34;timestamp-wrapper&#34;&gt;&lt;span class=&#34;timestamp&#34;&gt;[2020-05-31 Sun 17:23]&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;: I published a &lt;a href=&#34;https://punchagan.muse-amuse.in/blog/deploying-hugo-drafts-simplified&#34;&gt;simpler workflow&lt;/a&gt; for this, using&#xA;Hugo&amp;rsquo;s build options that I wasn&amp;rsquo;t aware of, because they are relatively new.&lt;/p&gt;&#xA;&lt;p&gt;A few friends and I run a weekly writing club similar to &lt;a href=&#34;https://github.com/sursh/writing-club&#34;&gt;this&lt;/a&gt;. Once we have our&#xA;drafts ready, we usually share them for reviews, etc.&lt;/p&gt;&#xA;&lt;p&gt;Previously, I used to use &lt;a href=&#34;https://getnikola.com&#34;&gt;Nikola&lt;/a&gt;, and it&amp;rsquo;s default behaviour is what worked well&#xA;for this workflow &amp;ndash; share the posts URL with reviewers, but the post shouldn&amp;rsquo;t&#xA;appear in the feed, post list, etc.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;If you set the status metadata field of a post to &lt;code&gt;draft&lt;/code&gt;, it will not be shown&#xA;in indexes and feeds. It will be compiled, and if you deploy it it will be made&#xA;available, so use with care. If you wish your drafts to be not available in your&#xA;deployed site, you can set &lt;code&gt;DEPLOY_DRAFTS = False&lt;/code&gt; in your configuration.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I moved to using Hugo a few years ago. By default, it doesn&amp;rsquo;t publish the draft&#xA;posts, but you could ask it to do so using the &lt;code&gt;--buildDrafts&lt;/code&gt; option. But, that&#xA;doesn&amp;rsquo;t do what I want &amp;ndash; draft posts are treated just like any other post, and&#xA;they appear in the feeds, post list, etc.&lt;/p&gt;&#xA;&lt;p&gt;Given how fast &lt;code&gt;hugo&lt;/code&gt; builds are, though, it is pretty easy to hack-up the&#xA;behaviour I want.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Run a build with drafts, say to &lt;code&gt;dev&lt;/code&gt; directory.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;DEV_DIR&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;dev&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Build drafts to dev dir&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hugo --cleanDestinationDir -D -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;DEV_DIR&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &amp;gt; /dev/null&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Run a build without drafts, to &lt;code&gt;public&lt;/code&gt; directory.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;PUBLIC_DIR&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;public&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hugo --cleanDestinationDir -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PUBLIC_DIR&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Copy the drafts from the &lt;code&gt;dev&lt;/code&gt; build to the &lt;code&gt;public&lt;/code&gt; build&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rsync -ri --ignore-existing &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;DEV_DIR&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;/ &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;PUBLIC_DIR&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Deploy the &lt;code&gt;public&lt;/code&gt; build&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The code above is &lt;a href=&#34;https://github.com/punchagan/dotfiles/blob/3652a6be42c776c6d1771e6cd46acadb2cafe295/bin/publish-hugo-drafts.sh&#34;&gt;here&lt;/a&gt; as a single script. &lt;a href=&#34;https://github.com/punchagan/punchagan.muse-amuse.in/blob/fdc80a61e28290c1c4a48a437bc77ec3fda811f5/deploy.sh&#34;&gt;Here&lt;/a&gt; is the full deployment script&#xA;for my blog.&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
