<linkhref="https://mcshelby.github.io/hugo-theme-relearn/basics/installation/index.html"rel="canonical"type="text/html"title="Installation :: Hugo Relearn Theme">
<p>The following steps are here to help you initialize your new website. If you don’t know Hugo at all, we strongly suggest you learn more about it by following this <ahref="https://gohugo.io/overview/quickstart/"target="_blank">great documentation for beginners</a>.</p>
<divclass="wrap-code highlight"><pretabindex="0"><code>hugo new site <new_project></code></pre></div><h2id="install-the-theme">Install the theme</h2>
<p>Install the Relearn theme by following <ahref="https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme"target="_blank">this documentation</a> using Hugo’s module system.</p>
<p>This theme’s repository is: <ahref="https://github.com/McShelby/hugo-theme-relearn.git"target="_blank">https://github.com/McShelby/hugo-theme-relearn.git</a></p>
<p>Alternatively, you can <ahref="https://github.com/McShelby/hugo-theme-relearn/archive/main.zip"target="_blank">download the theme as .zip</a> file and extract it in the <code>themes</code> directory</p>
<p>If you install the theme from your git repository or GitHub, you have several options.</p>
<p>If you use the <code>head</code> of the <code>main</code> branch, you are using the development version. Usually it is fully functional but can break from time to time. We try to fix newly introduced bugs in this version as soon as possible.</p>
<p>Additionally you can checkout one of the tagged versions. These tagged versions correspond to an official <ahref="https://github.com/McShelby/hugo-theme-relearn/releases"target="_blank">releases from the GitHub repository</a>.</p>
<p>Besides the usual version tags (eg <code>1.2.3</code>) there are also tags for the main version (eg. <code>1.2.x</code>), major version (eg. <code>1.x</code>) and the latest (just <code>x</code>) released version making it easier for you to pin the theme to a certain version.</p>
<p>When building the website, you can set a theme by using <code>--theme</code> option. However, we suggest you modify the configuration file <code>hugo.toml</code> and set the theme as the default. You can also add the <code>[outputs]</code> section to enable the <ahref="/hugo-theme-relearn/basics/customization/index.html#activate-search">search functionality</a>.</p>
<p>Chapters are pages that contain other child pages. It has a special layout style and usually just contains a <em>chapter name</em>, the <em>title</em> and a <em>brief abstract</em> of the section.</p>
</span></span><spanclass="line"><spanclass="cl">Discover what this Hugo theme is all about and the core concepts behind it.</span></span></code></pre></div><p>renders as</p>
<p>The Relearn theme provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command</p>
<divclass="wrap-code highlight"><pretabindex="0"class="chroma"><codeclass="language-shell"data-lang="shell"><spanclass="line"><spanclass="cl">hugo new --kind chapter basics/_index.md</span></span></code></pre></div><p>By opening the given file, you should see the property <code>chapter=true</code> on top, meaning this page is a <em>chapter</em>.</p>
<p>By default all chapters and pages are created as a draft. If you want to render these pages, remove the property <code>draft: true</code> from the metadata.</p>
<h2id="create-your-first-content-pages">Create your first content pages</h2>
<p>Then, create content pages inside the previously created chapter. Here are two ways to create content in the chapter:</p>
<divclass="wrap-code highlight"><pretabindex="0"class="chroma"><codeclass="language-shell"data-lang="shell"><spanclass="line"><spanclass="cl">hugo new basics/first-content.md
</span></span><spanclass="line"><spanclass="cl">hugo new basics/second-content/_index.md</span></span></code></pre></div><p>Feel free to edit those files by adding some sample content and replacing the <code>title</code> value in the beginning of the files.</p>
<divclass="wrap-code highlight"><pretabindex="0"class="chroma"><codeclass="language-shell"data-lang="shell"><spanclass="line"><spanclass="cl">hugo serve</span></span></code></pre></div><p>Go to <code>http://localhost:1313</code></p>
<li>You have a left-side <strong>Basics</strong> menu, containing two submenus with names equal to the <code>title</code> properties in the previously created files.</li>
<li>The home page explains how to customize it by following the instructions.</li>
<li>When you run <code>hugo serve</code>, when the contents of the files change, the page automatically refreshes with the changes. Neat!</li>
</ol>
<h2id="build-the-website">Build the website</h2>
<p>When your site is ready to deploy, run the following command:</p>
<divclass="wrap-code highlight"><pretabindex="0"class="chroma"><codeclass="language-shell"data-lang="shell"><spanclass="line"><spanclass="cl">hugo</span></span></code></pre></div><p>A <code>public</code> folder will be generated, containing all static content and assets for your website. It can now be deployed on any web server.</p>
<p>This website can be automatically published and hosted with <ahref="https://www.netlify.com/"target="_blank">Netlify</a> (Read more about <ahref="https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/"target="_blank">Automated HUGO deployments with Netlify</a>). Alternatively, you can use <ahref="https://gohugo.io/hosting-and-deployment/hosting-on-github/"target="_blank">GitHub pages</a>.</p>