hugo-theme-relearn/basics/customization/index.print.html
2024-02-24 14:10:30 +00:00

273 lines
30 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.123.3">
<meta name="generator" content="Relearn 5.24.1+tip">
<meta name="description" content="Documentation for Hugo Relearn Theme">
<meta name="author" content="Sören Weber">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
<meta name="twitter:title" content="Customization :: Hugo Relearn Theme">
<meta name="twitter:description" content="Documentation for Hugo Relearn Theme">
<meta property="og:title" content="Customization :: Hugo Relearn Theme">
<meta property="og:description" content="Documentation for Hugo Relearn Theme">
<meta property="og:type" content="website">
<meta property="og:url" content="https://mcshelby.github.io/hugo-theme-relearn/basics/customization/index.html">
<meta property="og:image" content="https://mcshelby.github.io/hugo-theme-relearn/images/hero.png">
<meta property="og:site_name" content="Hugo Relearn Theme">
<title>Customization :: Hugo Relearn Theme</title>
<link href="https://mcshelby.github.io/hugo-theme-relearn/basics/customization/index.html" rel="alternate" hreflang="x-default">
<link href="https://mcshelby.github.io/hugo-theme-relearn/basics/customization/index.html" rel="alternate" hreflang="en">
<link href="https://mcshelby.github.io/hugo-theme-relearn/pir/basics/customization/index.html" rel="alternate" hreflang="art-pir">
<link href="https://mcshelby.github.io/hugo-theme-relearn/basics/customization/index.html" rel="canonical" type="text/html" title="Customization :: Hugo Relearn Theme">
<link href="/hugo-theme-relearn/basics/customization/index.xml" rel="alternate" type="application/rss+xml" title="Customization :: Hugo Relearn Theme">
<link href="/hugo-theme-relearn/images/logo.svg?1708783825" rel="icon" type="image/svg+xml">
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use -->
<link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1708783825" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fontawesome-all.min.css?1708783825" rel="stylesheet"></noscript>
<link href="/hugo-theme-relearn/css/nucleus.css?1708783825" rel="stylesheet">
<link href="/hugo-theme-relearn/css/auto-complete.css?1708783825" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/auto-complete.css?1708783825" rel="stylesheet"></noscript>
<link href="/hugo-theme-relearn/css/perfect-scrollbar.min.css?1708783825" rel="stylesheet">
<link href="/hugo-theme-relearn/css/fonts.css?1708783825" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="/hugo-theme-relearn/css/fonts.css?1708783825" rel="stylesheet"></noscript>
<link href="/hugo-theme-relearn/css/theme.css?1708783825" rel="stylesheet">
<link href="/hugo-theme-relearn/css/theme-relearn-auto.css?1708783825" rel="stylesheet" id="R-variant-style">
<link href="/hugo-theme-relearn/css/chroma-relearn-auto.css?1708783825" rel="stylesheet" id="R-variant-chroma-style">
<link href="/hugo-theme-relearn/css/variant.css?1708783825" rel="stylesheet">
<link href="/hugo-theme-relearn/css/print.css?1708783825" rel="stylesheet" media="print">
<link href="/hugo-theme-relearn/css/format-print.css?1708783825" rel="stylesheet">
<link href="/hugo-theme-relearn/css/ie.css?1708783825" rel="stylesheet">
<script src="/hugo-theme-relearn/js/url.js?1708783825"></script>
<script src="/hugo-theme-relearn/js/variant.js?1708783825"></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="/hugo-theme-relearn/index.search.js";
var root_url="/";
var baseUri=root_url.replace(/\/$/, '');
window.relearn = window.relearn || {};
window.relearn.baseUriFull='https:\/\/mcshelby.github.io\/hugo-theme-relearn/';
// variant stuff
window.relearn.themeVariantModifier='';
window.variants && variants.init( [ 'relearn-auto', 'relearn-light', 'relearn-dark', 'relearn-bright', 'zen-auto', 'zen-light', 'zen-dark', 'neon', 'learn', 'blue', 'green', 'red' ] );
// 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_Reset_view = `Reset view`;
window.T_View_reset = `View reset!`;
window.T_No_results_found = `No results found for "{0}"`;
window.T_N_results_found = `{1} results found for "{0}"`;
</script>
<style>
#R-body img.bg-white {
background-color: white;
}
</style>
</head>
<body class="mobile-support print disableInlineCopyToClipboard" data-url="/hugo-theme-relearn/basics/customization/index.html">
<div id="R-body" class="default-animation">
<div id="R-body-overlay"></div>
<nav id="R-topbar">
<div class="topbar-wrapper">
<div class="topbar-sidebar-divider"></div>
<div class="topbar-area topbar-area-start" data-area="start">
<div class="topbar-button topbar-button-sidebar" data-content-empty="disable" data-width-s="show" data-width-m="hide" data-width-l="hide"><button class="topbar-control" onclick="toggleNav()" type="button" title="Menu (CTRL&#43;ALT&#43;n)"><i class="fa-fw fas fa-bars"></i></button>
</div>
</div>
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList"><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="/hugo-theme-relearn/basics/index.html"><span itemprop="name">Basics</span></a><meta itemprop="position" content="1">&nbsp;>&nbsp;</li><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Customization</span><meta itemprop="position" content="2"></li>
</ol>
<div class="topbar-area topbar-area-end" data-area="end">
</div>
</div>
</nav>
<div id="R-main-overlay"></div>
<main id="R-body-inner" class="highlightable default" tabindex="-1">
<div class="flex-block-wrapper">
<article class="default">
<header class="headline">
</header>
<h1 id="customization">Customization</h1>
<h2 id="serving-your-page-from-a-subfolder">Serving your page from a subfolder</h2>
<p>If your site is served from a subfolder, eg. <code>https://example.com/mysite/</code>, you have to set the following lines to your <code>hugo.toml</code></p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">baseURL</span> <span class="p">=</span> <span class="s2">&#34;https://example.com/mysite/&#34;</span></span></span></code></pre></div><h2 id="serving-your-page-from-the-filesystem">Serving your page from the filesystem</h2>
<p>If you want your page served from the filesystem by using URLs starting with <code>file://</code> you&rsquo;ll need the following configuration in your <code>hugo.toml</code>:</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">relativeURLs</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div><p>The theme will append an additional <code>index.html</code> to all page bundle links by default to make the page be servable from the file system. If you don&rsquo;t care about the file system and only serve your page via a webserver you can also generate the links without this change by adding this to your <code>hugo.toml</code></p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">disableExplicitIndexURLs</span> <span class="p">=</span> <span class="kc">true</span></span></span></code></pre></div>
<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>Sublemental pages (like <code>sitemap.xml</code>, <code>rss.xml</code>) will always be generated with fully quallyfied URLs and will not work if your site is served from the filesystem.</p>
</div>
</div>
<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>If you want to use the search feature from the file system, migrating from an older installation of the theme, make sure to change your outputformat for the homepage from the now deprecated <code>json</code> to <code>search</code> <a href="/hugo-theme-relearn/basics/customization/index.html#activate-search">as seen below</a>.</p>
</div>
</div>
<h2 id="activate-search">Activate search</h2>
<p>If not already present, add the following lines in your <code>hugo.toml</code> file.</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><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">&#34;html&#34;</span><span class="p">,</span> <span class="s2">&#34;rss&#34;</span><span class="p">,</span> <span class="s2">&#34;search&#34;</span><span class="p">]</span></span></span></code></pre></div><p>This will generate a search index file at the root of your public folder ready to be consumed by the Lunr search library. Note that the <code>search</code> outputformat was named <code>json</code> in previous releases but was implemented differently. Although <code>json</code> still works, it is now deprecated.</p>
<h3 id="activate-dedicated-search-page">Activate dedicated search page</h3>
<p>You can add a dedicated search page for your page by adding the <code>searchpage</code> outputformat to your home page by adding the following lines in your <code>hugo.toml</code> file. This will cause Hugo to generate a new file <code>http://example.com/mysite/search.html</code>.</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><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">&#34;html&#34;</span><span class="p">,</span> <span class="s2">&#34;rss&#34;</span><span class="p">,</span> <span class="s2">&#34;search&#34;</span><span class="p">,</span> <span class="s2">&#34;searchpage&#34;</span><span class="p">]</span></span></span></code></pre></div><p>You can access this page by either clicking on the magnifier glass or by typing some search term and pressing <code>ENTER</code> inside of the menu&rsquo;s search box .</p>
<p><a href="#R-image-1926044d73e717fb32c9c980deaa070e" class="lightbox-link"><img src="/hugo-theme-relearn/basics/customization/search_page.png?&amp;width=60pc" alt="Screenshot of the dedicated search page" class="figure-image bg-white border lightbox noshadow" style="height: auto; width: 60pc;" loading="lazy"></a>
<a href="javascript:history.back();" class="lightbox-back" id="R-image-1926044d73e717fb32c9c980deaa070e"><img src="/hugo-theme-relearn/basics/customization/search_page.png?&amp;width=60pc" alt="Screenshot of the dedicated search page" class="lightbox-image bg-white border lightbox noshadow" loading="lazy"></a></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>To have Hugo create the dedicated search page successfully, you must not generate the URL <code>http://example.com/mysite/search.html</code> from your own content. This can happen if you set <code>uglyURLs=true</code> in your <code>hugo.toml</code> and defining a Markdown file <code>content/search.md</code>.</p>
<p>To make sure, there is no duplicate content for any given URL of your project, run <code>hugo --printPathWarnings</code>.</p>
</div>
</div>
<h2 id="activate-print-support">Activate print support</h2>
<p>You can activate print support to add the capability to print whole chapters or even the complete site. Just add the <code>print</code> output format to your home, section and page in your <code>hugo.toml</code> as seen below:</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><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">&#34;html&#34;</span><span class="p">,</span> <span class="s2">&#34;rss&#34;</span><span class="p">,</span> <span class="s2">&#34;print&#34;</span><span class="p">,</span> <span class="s2">&#34;search&#34;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">section</span> <span class="p">=</span> <span class="p">[</span><span class="s2">&#34;html&#34;</span><span class="p">,</span> <span class="s2">&#34;rss&#34;</span><span class="p">,</span> <span class="s2">&#34;print&#34;</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">page</span> <span class="p">=</span> <span class="p">[</span><span class="s2">&#34;html&#34;</span><span class="p">,</span> <span class="s2">&#34;rss&#34;</span><span class="p">,</span> <span class="s2">&#34;print&#34;</span><span class="p">]</span></span></span></code></pre></div><p>This will add a little printer icon in the top bar. It will switch the page to print preview when clicked. You can then send this page to the printer by using your browser&rsquo;s usual print functionality.</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>The resulting URL will not be <a href="https://gohugo.io/templates/output-formats/#configure-output-formats" target="_blank">configured ugly</a> in terms of <a href="https://gohugo.io/content-management/urls/#ugly-urls" target="_blank">Hugo&rsquo;s URL handling</a> even if you&rsquo;ve set <code>uglyURLs=true</code> in your <code>hugo.toml</code>. This is due to the fact that for one mime type only one suffix can be configured.</p>
<p>Nevertheless, if you&rsquo;re unhappy with the resulting URLs you can manually redefine <code>outputFormats.print</code> in your own <code>hugo.toml</code> to your liking.</p>
</div>
</div>
<h2 id="home-button-configuration">Home Button Configuration</h2>
<p>If the <code>disableLandingPageButton</code> option is set to <code>false</code>, a Home button will appear
on the left menu. It is an alternative for clicking on the logo. To edit the
appearance, you will have to configure the <code>landingPageName</code> for the defined languages:</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">.</span><span class="nx">en</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">...</span>
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">.</span><span class="nx">en</span><span class="p">.</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">landingPageName</span> <span class="p">=</span> <span class="s2">&#34;&lt;i class=&#39;fas fa-home&#39;&gt;&lt;/i&gt; Home&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">...</span>
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">.</span><span class="nx">pir</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="p">...</span>
</span></span><span class="line"><span class="cl"><span class="p">[</span><span class="nx">languages</span><span class="p">.</span><span class="nx">pir</span><span class="p">.</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">landingPageName</span> <span class="p">=</span> <span class="s2">&#34;&lt;i class=&#39;fas fa-home&#39;&gt;&lt;/i&gt; Arrr! Homme&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">...</span></span></span></code></pre></div><p>If this option is not configured for a specific language, they will get their default values:</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="nx">landingPageName</span> <span class="p">=</span> <span class="s2">&#34;&lt;i class=&#39;fas fa-home&#39;&gt;&lt;/i&gt; Home&#34;</span></span></span></code></pre></div><p>The home button is going to look like this:</p>
<p><a href="#R-image-255cc3e3979929f1a1c6bc5c07b4b6ad" class="lightbox-link"><img src="/hugo-theme-relearn/basics/customization/home_button_defaults.png?width=18.75rem" alt="Default Home Button" class="figure-image bg-white border lightbox noshadow" style="height: auto; width: 18.75rem;" loading="lazy"></a>
<a href="javascript:history.back();" class="lightbox-back" id="R-image-255cc3e3979929f1a1c6bc5c07b4b6ad"><img src="/hugo-theme-relearn/basics/customization/home_button_defaults.png?width=18.75rem" alt="Default Home Button" class="lightbox-image bg-white border lightbox noshadow" loading="lazy"></a></p>
<h2 id="social-media-meta-tags">Social Media Meta Tags</h2>
<p>You can add social media meta tags for the <a href="https://gohugo.io/templates/internal/#open-graph" target="_blank">Open Graph</a> protocol and <a href="https://gohugo.io/templates/internal/#twitter-cards" target="_blank">Twitter Cards</a> to your site. These are configured as mentioned in the Hugo docs.</p>
<h2 id="change-the-menu-width">Change the Menu Width</h2>
<p>The menu width adjusts automatically for different screen sizes.</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Screen Width</th>
<th>Menu Width</th>
</tr>
</thead>
<tbody>
<tr>
<td>S</td>
<td>&lt; 48rem</td>
<td>14.375rem</td>
</tr>
<tr>
<td>M</td>
<td>48rem - 60rem</td>
<td>14.375rem</td>
</tr>
<tr>
<td>L</td>
<td>&gt;= 60rem</td>
<td>18.75rem</td>
</tr>
</tbody>
</table>
<p>The values for the screen width breakpoints aren&rsquo;t configurable.</p>
<p>If you want to adjust the menu width you can define the following CSS variables in your <code>custom-header.html</code>. Note that <code>--MENU-WIDTH-S</code> applies to the menu flyout width in mobile mode for small screen sizes.</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-css" data-lang="css"><span class="line"><span class="cl"><span class="p">:</span><span class="nd">root</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nv">--MENU-WIDTH-S</span><span class="p">:</span> <span class="mf">14.375</span><span class="kt">rem</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="nv">--MENU-WIDTH-M</span><span class="p">:</span> <span class="mf">14.375</span><span class="kt">rem</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"> <span class="nv">--MENU-WIDTH-L</span><span class="p">:</span> <span class="mf">18.75</span><span class="kt">rem</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div><h2 id="own-shortcodes-with-javascript-dependencies">Own Shortcodes with JavaScript Dependencies</h2>
<p>Certain shortcodes make use of additional JavaScript files. The theme only loads these dependencies if the shortcode is used. To do so correctly the theme adds management code in various files.</p>
<p>You can you use this mechanism in your own shortcodes. Say you want to add a shortcode <code>myshortcode</code> that also requires the <code>jquery</code> JavaScript library.</p>
<ol>
<li>
<p>Write the shortcode file <code>layouts/shortcodes/myshortcode.html</code> and add the following line</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="p">{{</span><span class="o">-</span> <span class="p">.</span><span class="nx">Page</span><span class="p">.</span><span class="nx">Store</span><span class="p">.</span><span class="nx">Set</span> <span class="s">&#34;hasMyShortcode&#34;</span> <span class="kc">true</span> <span class="p">}}</span></span></span></code></pre></div></li>
<li>
<p>Add the following snippet to your <code>hugo.toml</code></p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-go" data-lang="go"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">.</span><span class="nx">relearn</span><span class="p">.</span><span class="nx">dependencies</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="p">[</span><span class="nx">params</span><span class="p">.</span><span class="nx">relearn</span><span class="p">.</span><span class="nx">dependencies</span><span class="p">.</span><span class="nx">myshortcode</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">name</span> <span class="p">=</span> <span class="s">&#34;MyShortcode&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="nx">location</span> <span class="p">=</span> <span class="s">&#34;footer&#34;</span></span></span></code></pre></div></li>
<li>
<p>Add the dependency loader file <code>layouts/partials/dependencies/myshortcode.html</code>. The loader file will be appended to your header or footer, dependend on the <code>location</code> setting in your <code>hugo.toml</code>.</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">&#34;https://www.unpkg.com/jquery/dist/jquery.js&#34;</span><span class="p">&gt;&lt;/</span><span class="nt">script</span><span class="p">&gt;</span></span></span></code></pre></div></li>
</ol>
<p>Character casing is relevant!</p>
<ul>
<li>the <code>name</code> setting in your <code>hugo.toml</code> must match the key (that needs to be prefixed with a <code>has</code>) you used for the store in your <code>layouts/shortcodes/myshortcode.html</code>.</li>
<li>the key on <code>params.relearn.dependencies</code> in your <code>hugo.toml</code> must match the base file name of your loader file.</li>
</ul>
<p>See the <code>math</code>, <code>mermaid</code> and <code>openapi</code> shortcodes for examples.</p>
<h2 id="output-formats">Output Formats</h2>
<p>Certain parts of the theme can be changed for support of your own <a href="https://gohugo.io/templates/output-formats/" target="_blank">output formats</a>. Eg. if you define a new output format <code>PLAINTEXT</code> in your <code>hugo.toml</code>, you can add a file <code>layouts/partials/header.plaintext.html</code> to change the way, the page header should look like for that output format.</p>
<h2 id="react-to-variant-switches-in-javascript">React to Variant Switches in JavaScript</h2>
<p>Once a color variant is fully loaded, either initially or by switching the color variant manually with the variant selector, the custom event <code>themeVariantLoaded</code> on the <code>document</code> will be dispatched. You can add an event listener and react to changes.</p>
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="nb">document</span><span class="p">.</span><span class="nx">addEventListener</span><span class="p">(</span> <span class="s1">&#39;themeVariantLoaded&#39;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span> <span class="nx">e</span> <span class="p">){</span>
</span></span><span class="line"><span class="cl"> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">e</span><span class="p">.</span><span class="nx">detail</span><span class="p">.</span><span class="nx">variant</span> <span class="p">);</span> <span class="c1">// `relearn-light`
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="p">});</span></span></span></code></pre></div><h2 id="partials">Partials</h2>
<p>The Relearn theme has been built to be as configurable as possible by defining multiple <a href="https://gohugo.io/templates/partials/" target="_blank">partials</a></p>
<p>In <code>themes/hugo-theme-relearn/layouts/partials/</code>, you will find all the partials defined for this theme. If you need to overwrite something, don&rsquo;t change the code directly. Instead <a href="https://gohugo.io/themes/customizing/" target="_blank">follow this page</a>. You&rsquo;d create a new partial in the <code>layouts/partials</code> folder of your local project. This partial will have the priority.</p>
<p>This theme defines the following partials :</p>
<ul>
<li><code>header.html</code>: the header of the page. See <a href="/hugo-theme-relearn/basics/customization/index.html#output-formats">output-formats</a></li>
<li><code>footer.html</code>: the footer of the page. See <a href="/hugo-theme-relearn/basics/customization/index.html#output-formats">output-formats</a></li>
<li><code>body.html</code>: the body of the page. The body may contain of one or many articles. See <a href="/hugo-theme-relearn/basics/customization/index.html#output-formats">output-formats</a></li>
<li><code>article.html</code>: the output for a single article, can contain elements around your content. See <a href="/hugo-theme-relearn/basics/customization/index.html#output-formats">output-formats</a></li>
<li><code>menu.html</code>: left menu. <em>Not meant to be overwritten</em></li>
<li><code>search.html</code>: search box. <em>Not meant to be overwritten</em></li>
<li><code>custom-header.html</code>: custom headers in page. Meant to be overwritten when adding CSS imports. Don&rsquo;t forget to include <code>style</code> HTML tag directive in your file.</li>
<li><code>custom-footer.html</code>: custom footer in page. Meant to be overwritten when adding JavaScript. Don&rsquo;t forget to include <code>javascript</code> HTML tag directive in your file.</li>
<li><code>favicon.html</code>: the favicon</li>
<li><code>heading.html</code>: side-wide configuration to change the pages title headings.</li>
<li><code>heading-pre.html</code>: side-wide configuration to prepend to pages title headings. If you override this, it is your responsibility to take the page&rsquo;s <code>headingPre</code> setting into account.</li>
<li><code>heading-post.html</code>: side-wide configuration to append to pages title headings. If you override this, it is your responsibility to take the page&rsquo;s <code>headingPost</code> setting into account.</li>
<li><code>logo.html</code>: the logo, on top left hand corner</li>
<li><code>meta.html</code>: HTML meta tags, if you want to change default behavior</li>
<li><code>menu-pre.html</code>: side-wide configuration to prepend to menu items. If you override this, it is your responsibility to take the page&rsquo;s <code>menuPre</code> setting into account.</li>
<li><code>menu-post.html</code>: side-wide configuration to append to menu items. If you override this, it is your responsibility to take the page&rsquo;s <code>menuPost</code> setting into account.</li>
<li><code>menu-footer.html</code>: footer of the the left menu</li>
<li><code>toc.html</code>: table of contents</li>
<li><code>content.html</code>: the content page itself. This can be overridden if you want to display page&rsquo;s meta data above or below the content.</li>
<li><code>content-header.html</code>: header above the title, has a default implementation but you can overwrite it if you don&rsquo;t like it.</li>
<li><code>content-footer.html</code>: footer below the content, has a default implementation but you can overwrite it if you don&rsquo;t like it.</li>
</ul>
<footer class="footline">
</footer>
</article>
</div>
</main>
</div>
<script src="/hugo-theme-relearn/js/clipboard.min.js?1708783825" defer></script>
<script src="/hugo-theme-relearn/js/perfect-scrollbar.min.js?1708783825" defer></script>
<script src="/hugo-theme-relearn/js/theme.js?1708783825" defer></script>
</body>
</html>