<!doctype html><htmllang=en-audir=ltrclass=scroll-smoothdata-default-appearance=lightdata-auto-appearance=true><head><metacharset=utf-8><metahttp-equiv=content-languagecontent="en-au"><metaname=viewportcontent="width=device-width,initial-scale=1"><metahttp-equiv=x-ua-compatiblecontent="ie=edge"><title>Hosting & Deployment · Congo</title><metaname=titlecontent="Hosting & Deployment · Congo"><metaname=descriptioncontent="A powerful, lightweight theme for Hugo built with Tailwind CSS."><linkrel=canonicalhref=https://jpanther.github.io/congo/docs/hosting-deployment/><linktype=text/cssrel=stylesheethref=/congo/css/main.bundle.min.9c23c648e640c16018342c8c612bb089be14f3d92595f63e394d1b8ac7156c6eced0fad183355971ab53da70d5fe2cd333313a4a2917002780ac9a6ea88ac531.cssintegrity="sha512-nCPGSOZAwWAYNCyMYSuwib4U89kllfY+OU0biscVbG7O0PrRgzVZcatT2nDV/izTMzE6SikXACeArJpuqIrFMQ=="><scripttype=text/javascriptsrc=/congo/js/appearance.min.badab316c9287a5a42a843e4eb45da65bb3d194a5a0f5fa4a3e516160e67df0b8c65f4f19a8e146436e29d583699e6cb41d6bbe99e05e1dbaa877763bad9f8e2.jsintegrity="sha512-utqzFskoelpCqEPk60XaZbs9GUpaD1+ko+UWFg5n3wuMZfTxmo4UZDbinVg2mebLQda76Z4F4duqh3djutn44g=="></script>
<spanclass=mb-[2px]><ahref=https://github.com/jpanther/congo/tree/dev/exampleSite/content/docs/hosting-deployment/index.mdclass="text-lg hover:text-primary-500"rel="noopener noreferrer"target=_blanktitle="Edit content"><spanclass="relative inline-block align-text-bottom icon"><svgxmlns="http://www.w3.org/2000/svg"viewBox="0 0 512 512"><pathfill="currentcolor"d="M490.3 40.4c21.9 21.87 21.9 57.33.0 79.2l-30 30.1-98-97.98 30.1-30.06C414.3-.2135 449.7-.2135 471.6 21.66L490.3 40.4zM172.4 241.7 339.7 74.34l98 97.96L270.3 339.6C264.2 345.8 256.7 350.4 248.4 353.2l-88.8 29.6C150.1 385.6 141.5 383.4 135 376.1 128.6 370.5 126.4 361 129.2 352.4l29.6-88.8C161.6 255.3 166.2 247.8 172.4 241.7v0zM192 63.1c17.7.0 32 15.23 32 32 0 18.6-14.3 32-32 32H96c-17.67.0-32 15.2-32 32V416c0 17.7 14.33 32 32 32H352c17.7.0 32-14.3 32-32V319.1c0-16.8 14.3-32 32-32s32 15.2 32 32V416c0 53-43 96-96 96H96c-53.02.0-96-43-96-96V159.1c0-53 42.98-96 96-96h96z"/></svg></span></a></span></div></div></header><sectionclass="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row"><divclass="order-first px-0 lg:order-last lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8"><divclass="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky lg:top-10"><detailsopenclass="mt-0 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5"><summaryclass="block py-1 text-lg font-semibold cursor-pointer bg-neutral-100 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden">Table of Contents</summary><divclass="py-2 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600"><navid=TableOfContents><ul><li><ahref=#github-pages>GitHub Pages</a></li><li><ahref=#netlify>Netlify</a></li><li><ahref=#render>Render</a></li><li><ahref=#cloudflare-pages>Cloudflare Pages</a></li><li><ahref=#shared-hosting-vps-or-private-web-server>Shared hosting, VPS or private web server</a></li></ul></nav></div></details></div></div><divclass="min-w-0 min-h-0 max-w-prose grow"><p>There are many ways to deploy your Hugo website built with Congo. The theme is designed to be flexible in almost any deployment scenario.</p><p>Congo is built using relative URLs throughout the theme. This enables sites to easily be deployed to sub-folders and hosts like GitHub Pages. There’s usually no special configuration required for this to work as long as the <code>baseURL</code> parameter has been configured in the <code>config.toml</code> file.</p><p>The official Hugo <ahref=https://gohugo.io/hosting-and-deployment/target=_blank>Hosting and Deployment</a> docs are the best place to learn how to deploy your site. The sections below contain some specific theme configuration details that can help you deploy smoothly with certain providers.</p><p><strong>Choose your provider:</strong></p><ul><li><ahref=#github-pages>GitHub Pages</a></li><li><ahref=#netlify>Netlify</a></li><li><ahref=#render>Render</a></li><li><ahref=#cloudflare-pages>Cloudflare Pages</a></li><li><ahref=#shared-hosting-vps-or-private-web-server>Shared hosting, VPS or private web server</a></li></ul><hr><h2id=github-pagesclass="relative group">GitHub Pages <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#github-pagesaria-label=Anchor>#</a></span></h2><p>GitHub allows hosting on <ahref=https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pagestarget=_blank>GitHub Pages</a> using Actions. To enable this functionality, enable Pages on your repo and create a new Actions workflow to build and deploy your site.</p><p>The file needs to be in YAML format, placed within the <code>.github/workflows/</code> directory of your GitHub repository and named with a <code>.yml</code> extension.</p><divclass="flex px-4 py-3 rounded-md bg-primary-100 dark:bg-primary-900"><spanclass="text-primary-400ltr:pr-3rt
</span></span></span></code></pre></div><p>Push the config file to GitHub and the action should automatically run. It may fail the first time and you’ll need to visit the <strong>Settings > Pages</strong> section of your GitHub repo to check the source is correct. It should be set to use the <code>gh-pages</code> branch.</p><figure><imgsrc=/congo/docs/hosting-deployment/github-pages-source.jpgalt="Screen capture of GitHub Pages source"width=100%height=autostyle=max-width:565px;max-height:95px></figure><p>Once the settings are configured, re-run the action and the site should build and deploy correctly. You can consult the actions log to check everything deployed successfully.</p><h2id=netlifyclass="relative group">Netlify <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#netlifyaria-label=Anchor>#</a></span></h2><p>To deploy to <ahref=https://www.netlify.comtarget=_blank>Netlify</a>, create a new continuous deployment site and link it to your source code. The build settings can be left blank in the Netlify UI. You will only need to configure the domain you’ll be using.</p><figure><imgsrc=/congo/docs/hosting-deployment/netlify-build-settings.jpgalt="Screen capture of Netlify build settings"width=100%height=autostyle=max-width:479px;max-height:331px></figure><p>Then in the root of your site repository, create a <code>netlify.toml</code> file:</p><divclass=highlight><pretabindex=0class=chroma><codeclass=language-tomldata-lang=toml><spanclass=line><spanclass=cl><spanclass=c># netlify.toml</span>
</span></span><spanclass=line><spanclass=cl><spanclass=nx>command</span><spanclass=p>=</span><spanclass=s2>"hugo mod get -u && hugo --gc --minify -b $URL"</span>
</span></span><spanclass=line><spanclass=cl><spanclass=nx>TZ</span><spanclass=p>=</span><spanclass=s2>"UTC"</span><spanclass=c># Set to preferred timezone</span>
</span></span></code></pre></div><p>This configuration assumes you are deploying Congo as a Hugo module. If you have installed the theme using another method, change the build command to simply <code>hugo --gc --minify -b $URL</code>.</p><p>When you push the config file to your repo, Netlify should automatically deploy your site. You can check the deploy logs in the Netlify UI to check for any errors.</p><h2id=renderclass="relative group">Render <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#renderaria-label=Anchor>#</a></span></h2><p>Deploying to <ahref=https://render.comtarget=_blank>Render</a> is very straightforward and all configuration is via the Render UI.</p><p>Create a new <strong>Static Site</strong> and link it to your project’s code repository. Then simply configure the build command to be <code>hugo --gc --minify</code> and publish directory to be <code>public</code>.</p><figure><imgsrc=/congo/docs/hosting-deployment/render-settings.jpgalt="Screen capture of Render settings"width=100%height=autostyle=max-width:628px;max-height:227px></figure><p>The site will automatically build and deploy whenever you push a change to your repo.</p><h2id=cloudflare-pagesclass="relative group">Cloudflare Pages <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#cloudflare-pagesaria-label=Anchor>#</a></span></h2><p>Cloudflare offers the <ahref=https://pages.cloudflare.com/target=_blank>Pages</a> service that can host Hugo blogs. It builds the site from a git repository and then hosts it on Cloudflare’s CDN. Follow their <ahref=https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-sitetarget=_blank>Hugo deployment guide</a> to get started.</p><p>The Rocket Loader™ feature offered by Cloudflare tries to speed up rendering of web pages with JavaScript, but it breaks the appearance switcher in the theme. It can also cause an annoying light/dark screen flash when browsing your site due to scripts loading in the wrong order.</p><p>This problem can be fixed by disabling it:</p><ul><li>Go to the <ahref=https://dash.cloudflare.comtarget=_blank>Cloudflare dashboard</a></li><li>Click on your domain name in the list</li><li>Click <em>Optimization</em> in the <em>Speed</em> section</li><li>Scroll down to <em>Rocket Loader™</em> and disable it</li></ul><p>Hugo sites built with Congo still load very quickly, even with this feature disabled.</p><h2id=shared-hosting-vps-or-private-web-serverclass="relative group">Shared hosting, VPS or private web server <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#shared-hosting-vps-or-private-web-serveraria-label=Anchor>#</a></span></h2><p>Using traditional web hosting, or deploying to your own web server, is as simple as building your Hugo site and transferring the files to your host.</p><p>Make sure that the <code>baseURL</code> parameter in <code>config.toml</code> is set to the full URL to the root of your website (including any sub domains or sub-folders).</p><p>Then build your site using <code>hugo</code> and copy the contents of the output directory to the root of your web server and you will be ready to go. By default, the output directory is named <code>public</code>.</p><p><em>If you need a hosting provider, check out <ahref="https://www.vultr.com/?ref=8957394-8H"target=_blank>Vultr</a> or <ahref=https://m.do.co/c/36841235e565target=_blank>DigitalOcean</a>. Signing up using these affiliate links will give you up to $100 in free credit so you can try the service.</em