<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/"rel="external"target="_blank">great documentation for beginners</a>.</p>
<p>Hugo provides a <code>new</code> command to create a new website:</p>
<divclass="highlight wrap-code"><pretabindex="0"class="chroma"><codeclass="language-shell"data-lang="shell"><spanclass="line"><spanclass="cl">hugo new site my-new-site</span></span></code></pre></div><p>After that change into the directory:</p>
<divclass="highlight wrap-code"><pretabindex="0"class="chroma"><codeclass="language-shell"data-lang="shell"><spanclass="line"><spanclass="cl"><spanclass="nb">cd</span> my-new-site</span></span></code></pre></div><p>Every upcoming command will be executed from inside your new site’s root.</p>
<p>You can <ahref="https://github.com/McShelby/hugo-theme-relearn/archive/main.zip"rel="external"target="_blank">download the theme as .zip</a> file and extract it into them <code>themes/hugo-theme-relearn</code> directory.</p>
<p>Install the Relearn theme by following <ahref="https://gohugo.io/hugo-modules/use-modules/#use-a-module-for-a-theme"rel="external"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"rel="external"target="_blank">https://github.com/McShelby/hugo-theme-relearn.git</a></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"rel="external"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.</p>
<h2id="create-your-home-page">Create your Home Page</h2>
<p>If you don’t create a home page, yet, the theme will generate a placeholder text with instructions how to proceed.</p>
<p>Start your journey by filling the home page with content</p>
<divclass="highlight wrap-code"><pretabindex="0"class="chroma"><codeclass="language-shell"data-lang="shell"><spanclass="line"><spanclass="cl">hugo new --kind home _index.md</span></span></code></pre></div><p>By opening the given file, you should see the property <code>archetype=home</code> on top, meaning this page is a home page. The Relearn theme provides <ahref="/hugo-theme-relearn/cont/archetypes/index.html">some archetypes</a> to create those skeleton files for your website.</p>
<p>Obviously you better should change the page’s content.</p>
<h2id="create-your-first-chapter-page">Create your First Chapter Page</h2>
<p>Chapters are pages that contain other child pages. It has a special layout style and usually just contains 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>Begin by creating your first chapter page with the following command:</p>
<divclass="highlight wrap-code"><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>archetype=chapter</code> on top, meaning this page is a <em>chapter</em>.</p>
<p>The <code>weight</code> number will be used to generate the subtitle of the chapter page, set the number to a consecutive value starting at 1 for each new chapter level.</p>
<h2id="create-your-first-content-pages">Create your First Content Pages</h2>
<divclass="highlight wrap-code"><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="highlight wrap-code"><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>
<divclass="highlight wrap-code"><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 content and assets for your website. It can now be deployed on any web server.</p>
<p>Now it’s time to deploy your page by simply uploading your project to some web server or by using one of <ahref="https://gohugo.io/hosting-and-deployment/"rel="external"target="_blank">Hugo’s many deployment options</a>.</p>