mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-24 00:03:10 +00:00
157 lines
13 KiB
HTML
157 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" dir="ltr">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
|
<meta name="generator" content="Hugo 0.110.0">
|
|
<meta name="generator" content="Relearn 5.11.2+tip">
|
|
<meta name="description" content="Documentation for Hugo Relearn Theme">
|
|
<meta name="author" content="Sören Weber">
|
|
<title>Installation :: Hugo Relearn Theme</title>
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/installation/index.html" rel="alternate" hreflang="x-default">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/installation/index.html" rel="alternate" hreflang="en">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/pir/basics/installation/index.html" rel="alternate" hreflang="pir">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/installation/index.html" rel="canonical" type="text/html" title="Installation :: Hugo Relearn Theme">
|
|
<link href="../../basics/installation/index.xml" rel="alternate" type="application/rss+xml" title="Installation :: Hugo Relearn Theme">
|
|
<link href="../../images/logo.svg?1675891447" rel="icon" type="image/svg+xml">
|
|
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use -->
|
|
<link href="../../css/fontawesome-all.min.css?1675891449" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fontawesome-all.min.css?1675891449" rel="stylesheet"></noscript>
|
|
<link href="../../css/auto-complete.css?1675891449" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/auto-complete.css?1675891449" rel="stylesheet"></noscript>
|
|
<link href="../../css/perfect-scrollbar.min.css?1675891449" rel="stylesheet">
|
|
<link href="../../css/nucleus.css?1675891449" rel="stylesheet">
|
|
<link href="../../css/fonts.css?1675891449" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fonts.css?1675891449" rel="stylesheet"></noscript>
|
|
<link href="../../css/theme.css?1675891449" rel="stylesheet">
|
|
<link href="../../css/theme-auto.css?1675891449" rel="stylesheet" id="variant-style">
|
|
<link href="../../css/ie.css?1675891449" rel="stylesheet">
|
|
<link href="../../css/variant.css?1675891449" rel="stylesheet">
|
|
<link href="../../css/print.css?1675891449" rel="stylesheet" media="print">
|
|
<link href="../../css/format-print.css?1675891449" rel="stylesheet">
|
|
<script src="../../js/url.js?1675891449"></script>
|
|
<script src="../../js/variant.js?1675891449"></script>
|
|
<script>
|
|
// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:
|
|
// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72
|
|
window.index_js_url="../../index.search.js";
|
|
var root_url="../../";
|
|
var baseUri=root_url.replace(/\/$/, '');
|
|
// translations
|
|
window.T_Copy_to_clipboard = 'Copy to clipboard';
|
|
window.T_Copied_to_clipboard = 'Copied to clipboard!';
|
|
window.T_Copy_link_to_clipboard = 'Copy link to clipboard';
|
|
window.T_Link_copied_to_clipboard = 'Copied link to clipboard!';
|
|
window.T_No_results_found = 'No results found for \u0022{0}\u0022';
|
|
window.T_N_results_found = '{1} results found for \u0022{0}\u0022';
|
|
// some further base stuff
|
|
var baseUriFull='https:\/\/McShelby.github.io\/hugo-theme-relearn/';
|
|
window.variants && variants.init( [ 'auto', 'relearn-light', 'relearn-dark', 'learn', 'neon', 'blue', 'green', 'red' ] );
|
|
</script>
|
|
<style>
|
|
#body img.bg-white {
|
|
background-color: white;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="mobile-support print disableInlineCopyToClipboard" data-url="../../basics/installation/index.html">
|
|
<div id="body" class="default-animation">
|
|
<div id="sidebar-overlay"></div>
|
|
<div id="toc-overlay"></div>
|
|
<nav id="topbar" class="highlightable" dir="ltr">
|
|
<div>
|
|
<div id="breadcrumbs">
|
|
<span id="sidebar-toggle-span">
|
|
<a href="#" id="sidebar-toggle" class="topbar-link" title='Menu (CTRL+ALT+n)'><i class="fas fa-bars fa-fw"></i></a>
|
|
</span>
|
|
<ol class="links" itemscope itemtype="http://schema.org/BreadcrumbList">
|
|
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="../../index.html"><span itemprop="name">Hugo Relearn Theme</span></a><meta itemprop="position" content="1"> > </li>
|
|
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="../../basics/index.html"><span itemprop="name">Basics</span></a><meta itemprop="position" content="2"> > </li>
|
|
<li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Installation</span><meta itemprop="position" content="3"></li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<main id="body-inner" class="highlightable default" tabindex="-1">
|
|
<div class="flex-block-wrapper">
|
|
<div id="head-tags">
|
|
</div>
|
|
<article class="default">
|
|
<h1 id="installation">Installation</h1>
|
|
|
|
<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 <a href="https://gohugo.io/overview/quickstart/" target="_blank">great documentation for beginners</a>.</p>
|
|
<h2 id="create-your-project">Create your project</h2>
|
|
<p>Hugo provides a <code>new</code> command to create a new website.</p>
|
|
<pre tabindex="0"><code>hugo new site <new_project>
|
|
</code></pre><h2 id="install-the-theme">Install the theme</h2>
|
|
<p>Install the Relearn theme by following <a href="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: <a href="https://github.com/McShelby/hugo-theme-relearn.git" target="_blank">https://github.com/McShelby/hugo-theme-relearn.git</a></p>
|
|
<p>Alternatively, you can <a href="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>
|
|
<h3 id="from-git">From Git</h3>
|
|
<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 <a href="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>
|
|
<h2 id="basic-configuration">Basic configuration</h2>
|
|
<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>config.toml</code>) and set the theme as the default. You can also add the <code>[outputs]</code> section to enable the search functionality.</p>
|
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="c"># Change the default theme to be use when building the site with Hugo</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">theme</span> <span class="p">=</span> <span class="s2">"hugo-theme-relearn"</span>
|
|
</span></span><span class="line"><span class="cl">
|
|
</span></span><span class="line"><span class="cl"><span class="c"># For search functionality</span>
|
|
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">outputs</span><span class="p">]</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">home</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"HTML"</span><span class="p">,</span> <span class="s2">"RSS"</span><span class="p">,</span> <span class="s2">"SEARCH"</span><span class="p">]</span>
|
|
</span></span></code></pre></div><h2 id="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 a <em>chapter name</em>, the <em>title</em> and a <em>brief abstract</em> of the section.</p>
|
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-markdown" data-lang="markdown"><span class="line"><span class="cl"><span class="gu">### Chapter 1
|
|
</span></span></span><span class="line"><span class="cl"><span class="gu"></span>
|
|
</span></span><span class="line"><span class="cl"><span class="gh"># Basics
|
|
</span></span></span><span class="line"><span class="cl"><span class="gh"></span>
|
|
</span></span><span class="line"><span class="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>
|
|
|
|
<a href="#image-d6a140c3f22101322adef33bbc6e62e0" class="lightbox-link">
|
|
<img src="../../basics/installation/chapter.png?classes=shadow&width=60pc" alt="A Chapter" class="shadow" style="height: auto; width: 60pc;" loading="lazy">
|
|
</a>
|
|
<a href="javascript:history.back();" class="lightbox" id="image-d6a140c3f22101322adef33bbc6e62e0">
|
|
<img src="../../basics/installation/chapter.png?classes=shadow&width=60pc" alt="A Chapter" class="lightbox-image" loading="lazy">
|
|
</a></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>
|
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="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>
|
|
<h2 id="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>
|
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">hugo new basics/first-content.md
|
|
</span></span><span class="line"><span class="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>
|
|
<h2 id="launching-the-website-locally">Launching the website locally</h2>
|
|
<p>Launch by using the following command:</p>
|
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">hugo serve
|
|
</span></span></code></pre></div><p>Go to <code>http://localhost:1313</code></p>
|
|
<p>You should notice three things:</p>
|
|
<ol>
|
|
<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>
|
|
<h2 id="build-the-website">Build the website</h2>
|
|
<p>When your site is ready to deploy, run the following command:</p>
|
|
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="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>
|
|
|
|
<div class="box notices cstyle note">
|
|
<div class="box-label"><i class="fa-fw fas fa-exclamation-circle"></i> Note</div>
|
|
<div class="box-content">
|
|
<p>This website can be automatically published and hosted with <a href="https://www.netlify.com/" target="_blank">Netlify</a> (Read more about <a href="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 <a href="https://gohugo.io/hosting-and-deployment/hosting-on-github/" target="_blank">GitHub pages</a>.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="footline">
|
|
</footer>
|
|
</article>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
<script src="../../js/clipboard.min.js?1675891449" defer></script>
|
|
<script src="../../js/perfect-scrollbar.min.js?1675891449" defer></script>
|
|
<script src="../../js/theme.js?1675891449" defer></script>
|
|
</body>
|
|
</html>
|