<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hugo Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/hugo/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/hugo/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Tue, 05 Aug 2025 08:11:46 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>hugo Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/hugo/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Deploy a Hugo Static Site</title>
		<link>https://www.clever.cloud/blog/engineering/2020/06/18/deploy-static-site-hugo/</link>
		
		<dc:creator><![CDATA[Laurent Doguin]]></dc:creator>
		<pubDate>Thu, 18 Jun 2020 12:35:00 +0000</pubDate>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[hugo]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[static]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2020/06/18/deploy-static-site-hugo/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="hugobanner 1" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><div style="background: #ffffff; padding: 1.5rem; border: 1px solid #deddee; border-radius: 4px; margin: auto auto 2rem auto; max-width: var(--wp--style--global--content-size, 710px);">
<div style="display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;"><span style="font-size: 2rem;">⚡</span>
<h4 style="margin: 0; color: #333; font-weight: bold;">Update Available</h4>
</div>
<strong>The process has been simplified!</strong> Check out our new static runtime with automatic build for Hugo with version management.
<div class="push-documentation__content"><a class="button --white-border" href="https://www.clever.cloud/developers/doc/applications/static/">🚀 Discover easy Hugo deployment</a></div>
</div>
Clever Cloud launched a <a href="https://clever-cloud.com/fr/podcast">french speaking podcast</a> about two weeks ago. We decided to use the Hugo static site generator to make it available online. This post explains how we deployed it.

There are many technical solutions out there to host your podcast, like Ausha or Anchor. They will allow you to configure everything needed and upload your material so you get a proper RSS feed in the end. Because Podcast subscribtions are basically RSS feed subscribtions. And these services can also go the extra mile and automatically distribute your podcast to other sites. This is actually the main reason why we use Ausha. It's way easier.

That being said we still want to have a dedicated page on our existing website and host the RSS and media files ourselves. And it turns out there is a great <a href="https://github.com/mattstratton/castanet">Hugo theme</a> for podcast hosting.

If you are not familiar with <a href="https://gohugo.io/">Hugo</a> it's one of the most popular static site generator. It's fast, mature, loaded with cool features and still in active development. Community is super helpful and you will find many different themes for different purposes like blog, documentation, FAQ or even podcast.

To follow along you need to install git, hugo and <a href="https://github.com/CleverCloud/clever-tools">clever-tools</a>. Let's see how this works.
<h2 id="create-a-new-hugo-website">Create a new Hugo website</h2>
Creating a new Hugo website is pretty straightforward. Create a folder to contain your site and inside it run <code>hugo new site</code>. Then you can add the theme you want as a submodule, copy the theme sample configuration and you should be ready to start working on your site. Here's what I did:
<pre><code class="language-bash">mkdir mysite
cd mysite
hugo new site .
git init
git submodule add https://github.com/mattstratton/castanet themes/castanet
cp themes/castanet/exampleSite/config.toml config.toml 
git add .
git commit -m'init'
</code></pre>
From here you can run <code>hugo server</code> and your site will be available at <code>localhost:1313</code>, with automatic reloading and file modification watching. This command will fail because it cannot find the theme. No worries, it's because we copied the config file from the theme directory, and its theme folder location is hardcoded. We don't need it anymore. So go ahead and edit <code>config.toml</code>. Start by removing or commenting <code>themesdir</code> on line 6. Then add your own configuration and create new content. I have set the baseUrl to <code>clever-cloud.com/fr/podcast</code>.

Notice that this is not a traditional baseUrl as it's assuming something else is already running on clever-cloud.com. And this is fine, Clever Cloud knows how to manage this. From here you can add some content and finish your own configuration. Then it's time to deploy on Clever Cloud.
<h2 id="deploy-to-clever-cloud">Deploy to Clever Cloud</h2>
At the root of your website create a file called <code>hugo.sh</code> with the following content:
<pre><code class="language-bash">wget https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
tar xvf hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
chmod +x ./hugo
./hugo --gc --minify --destination public/fr/podcast
</code></pre>
Don't forget to make it executable with <code>chmod +x hugo.sh</code>, add and commit it. This script will be executed by Clever Cloud thanks to our <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">deployment hooks</a>. It downloads Hugo with the version you specified in the environment variables then run the build of the website. The build destination is specified manually as <code>public/fr/podcast</code>, the default would be <code>public</code>. This is because we need to serve the content on <em>clever-cloud.com/fr/podcast</em> and not just <em>clever-cloud.com</em>.

Now let's use clever-tools to create, configure and deploy the application. In the terminal run the following:
<pre><code class="language-bash">clever create --type static-apache mysite
clever domain add clever-cloud.com/fr/podcast
clever config set force-https enabled
clever env set CC_PRE_BUILD_HOOK "./hugo.sh"
clever env set CC_WEBROOT "/public"
clever env set HUGO_ENV "production"
clever env set HUGO_VERSION "0.68.3"
clever deploy
</code></pre>
This will create the application on Clever Cloud, add the custom domain <code>clever-cloud.com/fr/podcast</code>, and yes this works even though we already have an application serving <code>clever-cloud.com</code>. The new domain will take precedence. Then we enforce HTTPS redirection and set a bunch of environment variable for our configuration. Last command deploys the website to Clever Cloud. From here you should see logs popping up.

And this is it. You have deployed a static website in production that will be updated automatically each time you push new content, on top of an existing website. Please let us know if you have any questions about static site deployment.]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="hugobanner 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/hugobanner-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><div style="background: #ffffff; padding: 1.5rem; border: 1px solid #deddee; border-radius: 4px; margin: auto auto 2rem auto; max-width: var(--wp--style--global--content-size, 710px);">
<div style="display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;"><span style="font-size: 2rem;">⚡</span>
<h4 style="margin: 0; color: #333; font-weight: bold;">Update Available</h4>
</div>
<strong>The process has been simplified!</strong> Check out our new static runtime with automatic build for Hugo with version management.
<div class="push-documentation__content"><a class="button --white-border" href="https://www.clever.cloud/developers/doc/applications/static/">🚀 Discover easy Hugo deployment</a></div>
</div>
Clever Cloud launched a <a href="https://clever-cloud.com/fr/podcast">french speaking podcast</a> about two weeks ago. We decided to use the Hugo static site generator to make it available online. This post explains how we deployed it.

There are many technical solutions out there to host your podcast, like Ausha or Anchor. They will allow you to configure everything needed and upload your material so you get a proper RSS feed in the end. Because Podcast subscribtions are basically RSS feed subscribtions. And these services can also go the extra mile and automatically distribute your podcast to other sites. This is actually the main reason why we use Ausha. It's way easier.

That being said we still want to have a dedicated page on our existing website and host the RSS and media files ourselves. And it turns out there is a great <a href="https://github.com/mattstratton/castanet">Hugo theme</a> for podcast hosting.

If you are not familiar with <a href="https://gohugo.io/">Hugo</a> it's one of the most popular static site generator. It's fast, mature, loaded with cool features and still in active development. Community is super helpful and you will find many different themes for different purposes like blog, documentation, FAQ or even podcast.

To follow along you need to install git, hugo and <a href="https://github.com/CleverCloud/clever-tools">clever-tools</a>. Let's see how this works.
<h2 id="create-a-new-hugo-website">Create a new Hugo website</h2>
Creating a new Hugo website is pretty straightforward. Create a folder to contain your site and inside it run <code>hugo new site</code>. Then you can add the theme you want as a submodule, copy the theme sample configuration and you should be ready to start working on your site. Here's what I did:
<pre><code class="language-bash">mkdir mysite
cd mysite
hugo new site .
git init
git submodule add https://github.com/mattstratton/castanet themes/castanet
cp themes/castanet/exampleSite/config.toml config.toml 
git add .
git commit -m'init'
</code></pre>
From here you can run <code>hugo server</code> and your site will be available at <code>localhost:1313</code>, with automatic reloading and file modification watching. This command will fail because it cannot find the theme. No worries, it's because we copied the config file from the theme directory, and its theme folder location is hardcoded. We don't need it anymore. So go ahead and edit <code>config.toml</code>. Start by removing or commenting <code>themesdir</code> on line 6. Then add your own configuration and create new content. I have set the baseUrl to <code>clever-cloud.com/fr/podcast</code>.

Notice that this is not a traditional baseUrl as it's assuming something else is already running on clever-cloud.com. And this is fine, Clever Cloud knows how to manage this. From here you can add some content and finish your own configuration. Then it's time to deploy on Clever Cloud.
<h2 id="deploy-to-clever-cloud">Deploy to Clever Cloud</h2>
At the root of your website create a file called <code>hugo.sh</code> with the following content:
<pre><code class="language-bash">wget https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
tar xvf hugo_extended_"$HUGO_VERSION"_Linux-64bit.tar.gz
chmod +x ./hugo
./hugo --gc --minify --destination public/fr/podcast
</code></pre>
Don't forget to make it executable with <code>chmod +x hugo.sh</code>, add and commit it. This script will be executed by Clever Cloud thanks to our <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">deployment hooks</a>. It downloads Hugo with the version you specified in the environment variables then run the build of the website. The build destination is specified manually as <code>public/fr/podcast</code>, the default would be <code>public</code>. This is because we need to serve the content on <em>clever-cloud.com/fr/podcast</em> and not just <em>clever-cloud.com</em>.

Now let's use clever-tools to create, configure and deploy the application. In the terminal run the following:
<pre><code class="language-bash">clever create --type static-apache mysite
clever domain add clever-cloud.com/fr/podcast
clever config set force-https enabled
clever env set CC_PRE_BUILD_HOOK "./hugo.sh"
clever env set CC_WEBROOT "/public"
clever env set HUGO_ENV "production"
clever env set HUGO_VERSION "0.68.3"
clever deploy
</code></pre>
This will create the application on Clever Cloud, add the custom domain <code>clever-cloud.com/fr/podcast</code>, and yes this works even though we already have an application serving <code>clever-cloud.com</code>. The new domain will take precedence. Then we enforce HTTPS redirection and set a bunch of environment variable for our configuration. Last command deploys the website to Clever Cloud. From here you should see logs popping up.

And this is it. You have deployed a static website in production that will be updated automatically each time you push new content, on top of an existing website. Please let us know if you have any questions about static site deployment.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
