Create New Hugo Blog Site in Azure SWA


Do you just love doing cool stuff? This post details the steps to create this blog using the Hugo static site generator hosted in Azure static web apps using Windows. The price is just your time and effort. The tools in the prerequisites are free.

  • GitHub account
  • Azure subscription
  • Hugo installed
    • From the link above, scroll to assets > Click Show all nn assets.
    • Use extended version recommended for modern themes, e.g,
    • Unzip, rename the folder to hugo-amd64 and add the folder to c:\program files
    • Add %ProgramFiles%\hugo-amd64 folder to your path in system settings > environment variables.
    • I may make a blog post with these details.
  • Pick a Hugo theme. I use fuji for this post.
  • Visual studio with Git and Powershell installed
  • Navigate to > Name - swa-hugo-blog.
  • Optional: click Private.
  • Click Create repository.
  • Open bash.
  • Navigate to the appropriate folder for this GitHub repo, maybe Documents\repos.
  • Enter these commands in bash. Change the site to your site name.
hugo new site $site
cd $site
git init
git branch -M main
git add -A
git commit -m "initial commit"
git remote add origin[YOUR-GITHUB-USERNAME]/$site
git push --set-upstream origin main
  • You can ignore warnings from the git add -A command above.
  • Navigate to the repository containing your desired Hugo theme, e.g.,
  • Click Code > Download zip > unzip file to folder > rename the folder to something like ‘fuji’
  • Copy or move this folder to your repositiory’s themes folder

Open your repo folder in VS Code for these steps.

If you installed Hugo after version 0.110 (January, 2023), you should have a hugo.toml file which replaces the config.toml file. Most theme guides instruct you to copy the config.toml file to the root of your project, but better is to use the contents of the theme’s config.toml file to overwrite the hugo.toml file.

Then make these changes as approprite. If you are not using the fuji or lightbi theme, there may be different settings to look at.

title = "My Epic Blog"
subTitle = "Let's change the world!"

sourceURL = ""
author = "you"
showReadTime = true

showLicense = false

Update [[]] items as needed.

The fuji footer is in themes\fuji\layouts\partial\footer.html. I changed Source Code to my company Bullseye Cosulting and removed the Fuji link. I’ll keep link to Hugo for now.

    <div class="container-lg clearfix">
        <div class="col-12 footer">
            {{ if .Site.Params.showLicenseInFooter }}
                {{ i18n "postCopyrightFront" }}<a rel="license" href="{{ .Site.Params.licenseLink }}" target="_blank">{{ .Site.Params.license }}</a>{{ i18n "postCopyrightEnd" }}
            {{ end }}
            <span>&copy; {{ with .Site.Params.copyrightStartYear }}{{ . }}-{{ end }}{{ now.Format "2006" }}
                <a href="{{ .Site.BaseURL }}">{{ }}</a>
                {{ with .Site.Params.sourceURL }} | <a href="{{ . }}">Bullseye Consulting</a> {{ end }}
                | {{ i18n "footerPoweredFront" }}<a href=""
                                                    target="_blank">Hugo</a>{{ i18n "footerPoweredEnd" }}

Here are some tweaks I made to get the lightbi theme right.

  theme = "lightbi"
  name = "Blindman"
  • [Params] section changes
dateFormat = "January 2, 2006"
  • comment out most of [Author]
  • Update [[menu.main]] items as needed.

Phew. You should now be able to view your site. In VS Code PowerShell, run

hugo serve -D

Open http://localhost:1313/

  • Create a resource
  • Search for Static Web App > Static Web App > Create
    • I created a resource group called free-swa-eus2 for all my SWAs to make it easy to see if I’m getting close to the limit of 10. You can make a new resource group.
    • Name swa-hugo-blog
    • Choose the appropriate region.
    • Enter the GitHub Organization, Repository and Branch information.
    • Choose Hugo in the Build Presets dropdown.
    • Set App Location to /public. *Note that his causes the initial GitHub workflow action to fail. This is a good test to see if you are receivng email notification of failed GitHub jobs. If you prefer, you can use VS Code to update the .github/workflows/[SWA-IDKEY].yml file after you create the SWA with this code:
    app_location: "/public" # App source code path
    • Click Review + create > Create > Go to resource.

Use the public URL from your Azure Static Web App, something like,

baseURL = ''
  • In powershell, run
  • Click the source control icon > Message is fuji theme, initial footer updates, etc. commit > Yes
  • Click Sync Changes > OK
  • This will kick off the workflow job to move the content to the Azure SWA. You can monitor the progress in the actions tab of the GitHub project. When the light goes green, you can load the public URL from your Azure Static Web App to view your site.