mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 17:53:07 +00:00
260 lines
30 KiB
HTML
260 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.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>Configuration :: Hugo Relearn Theme</title>
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/configuration/index.html" rel="alternate" hreflang="x-default">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/configuration/index.html" rel="alternate" hreflang="en">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/pir/basics/configuration/index.html" rel="alternate" hreflang="pir">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/configuration/index.html" rel="canonical" type="text/html" title="Configuration :: Hugo Relearn Theme">
|
|
<link href="../../basics/configuration/index.xml" rel="alternate" type="application/rss+xml" title="Configuration :: Hugo Relearn Theme">
|
|
<link href="../../images/logo.svg?1676407394" 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?1676407395" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fontawesome-all.min.css?1676407395" rel="stylesheet"></noscript>
|
|
<link href="../../css/nucleus.css?1676407395" rel="stylesheet">
|
|
<link href="../../css/auto-complete.css?1676407395" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/auto-complete.css?1676407395" rel="stylesheet"></noscript>
|
|
<link href="../../css/perfect-scrollbar.min.css?1676407395" rel="stylesheet">
|
|
<link href="../../css/fonts.css?1676407395" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fonts.css?1676407395" rel="stylesheet"></noscript>
|
|
<link href="../../css/theme.css?1676407395" rel="stylesheet">
|
|
<link href="../../css/theme-auto.css?1676407395" rel="stylesheet" id="variant-style">
|
|
<link href="../../css/variant.css?1676407395" rel="stylesheet">
|
|
<link href="../../css/print.css?1676407395" rel="stylesheet" media="print">
|
|
<link href="../../css/format-print.css?1676407395" rel="stylesheet">
|
|
<link href="../../css/ie.css?1676407395" rel="stylesheet">
|
|
<script src="../../js/url.js?1676407395"></script>
|
|
<script src="../../js/variant.js?1676407395"></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/configuration/index.html">
|
|
<div id="body" class="default-animation">
|
|
<div id="sidebar-overlay"></div>
|
|
<div id="toc-overlay"></div>
|
|
<nav id="topbar" class="highlightable">
|
|
<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">Configuration</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="configuration">Configuration</h1>
|
|
|
|
<h2 id="global-site-parameters">Global site parameters</h2>
|
|
<p>On top of <a href="https://gohugo.io/overview/configuration/" target="_blank">Hugo global configuration</a>, the Relearn theme lets you define the following parameters in your <code>config.toml</code> (here, values are default).</p>
|
|
<p>Note that some of these parameters are explained in details in other sections of this documentation.</p>
|
|
<div class="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="c"># This controls whether submenus will be expanded (true), or collapsed (false) in the</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># menu; if no setting is given, the first menu level is set to false, all others to true;</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># this can be overridden in the pages frontmatter</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">alwaysopen</span> <span class="p">=</span> <span class="kc">true</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Prefix URL to edit current page. Will display an "Edit" button on top right hand corner of every page.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Useful to give opportunity to people to create merge request for your doc.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># See the config.toml file from this documentation site to have an example.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">editURL</span> <span class="p">=</span> <span class="s2">""</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Author of the site, will be used in meta information</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">author</span> <span class="p">=</span> <span class="s2">""</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Description of the site, will be used in meta information</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">description</span> <span class="p">=</span> <span class="s2">""</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Shows a checkmark for visited pages on the menu</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">showVisitedLinks</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Disable search function. It will hide search bar</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableSearch</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Disable search in hidden pages, otherwise they will be shown in search box</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableSearchHiddenPages</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Disables hidden pages from showing up in the sitemap and on Google (et all), otherwise they may be indexed by search engines</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableSeoHiddenPages</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Disables hidden pages from showing up on the tags page although the tag term will be displayed even if all pages are hidden</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableTagHiddenPages</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Javascript and CSS cache are automatically busted when new version of site is generated.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Set this to true to disable this behavior (some proxies don't handle well this optimization)</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableAssetsBusting</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Set this to true if you want to disable generation for generator version meta tags of hugo and the theme;</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># don't forget to also set Hugo's disableHugoGeneratorInject=true, otherwise it will generate a meta tag into your home page</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableGeneratorVersion</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Set this to true to disable copy-to-clipboard button for inline code.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableInlineCopyToClipBoard</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># A title for shortcuts in menu is set by default. Set this to true to disable it.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableShortcutsTitle</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If set to false, a Home button will appear below the search bar on the menu.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># It is redirecting to the landing page of the current language if specified. (Default is "/")</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableLandingPageButton</span> <span class="p">=</span> <span class="kc">true</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># When using mulitlingual website, disable the switch language button.</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableLanguageSwitchingButton</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Hide breadcrumbs in the header and only show the current page title</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableBreadcrumb</span> <span class="p">=</span> <span class="kc">true</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If set to true, hide table of contents menu in the header of all pages</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableToc</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If set to false, load the MathJax module on every page regardless if a MathJax shortcode is present</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableMathJax</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Specifies the remote location of the MathJax js</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">customMathJaxURL</span> <span class="p">=</span> <span class="s2">"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Initialization parameter for MathJax, see MathJax documentation</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">mathJaxInitialize</span> <span class="p">=</span> <span class="s2">"{}"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If set to false, load the Mermaid module on every page regardless if a Mermaid shortcode or Mermaid codefence is present</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableMermaid</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Specifies the remote location of the Mermaid js</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">customMermaidURL</span> <span class="p">=</span> <span class="s2">"https://unpkg.com/mermaid/dist/mermaid.min.js"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Initialization parameter for Mermaid, see Mermaid documentation</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">mermaidInitialize</span> <span class="p">=</span> <span class="s2">"{ \"theme\": \"default\" }"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If set to false, load the Swagger module on every page regardless if a Swagger shortcode is present</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableSwagger</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Specifies the remote location of the RapiDoc js</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">customSwaggerURL</span> <span class="p">=</span> <span class="s2">"https://unpkg.com/rapidoc/dist/rapidoc-min.js"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Initialization parameter for Swagger, see RapiDoc documentation</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">swaggerInitialize</span> <span class="p">=</span> <span class="s2">"{ \"theme\": \"light\" }"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Hide Next and Previous page buttons normally displayed full height beside content</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableNextPrev</span> <span class="p">=</span> <span class="kc">true</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Order sections in menu by "weight" or "title". Default to "weight";</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># this can be overridden in the pages frontmatter</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">ordersectionsby</span> <span class="p">=</span> <span class="s2">"weight"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Change default color scheme with a variant one. Eg. can be "auto", "red", "blue", "green" or an array like [ "blue", "green" ].</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">themeVariant</span> <span class="p">=</span> <span class="s2">"auto"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># Change the title separator. Default to "::".</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">titleSeparator</span> <span class="p">=</span> <span class="s2">"-"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If set to true, the menu in the sidebar will be displayed in a collapsible tree view. Although the functionality works with old browsers (IE11), the display of the expander icons is limited to modern browsers</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">collapsibleMenu</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If a single page can contain content in multiple languages, add those here</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">additionalContentLanguage</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"en"</span> <span class="p">]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># If set to true, no index.html will be appended to prettyURLs; this will cause pages not</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># to be servable from the file system</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">disableExplicitIndexURLs</span> <span class="p">=</span> <span class="kc">false</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="c"># For external links you can define how they are opened in your browser; this setting will only be applied to the content area but not the shortcut menu</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">externalLinkTarget</span> <span class="p">=</span> <span class="s2">"_blank"</span>
|
|
</span></span></code></pre></div><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>config.toml</code></p>
|
|
<div class="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">"https://example.com/mysite/"</span>
|
|
</span></span><span class="line"><span class="cl"><span class="nx">canonifyURLs</span> <span class="p">=</span> <span class="kc">true</span>
|
|
</span></span><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>Without <code>canonifyURLs=true</code> URLs in sublemental pages (like <code>sitemap.xml</code>, <code>rss.xml</code>) will be generated falsly while your HTML files will still work. See <a href="https://github.com/gohugoio/hugo/issues/5226" target="_blank">https://github.com/gohugoio/hugo/issues/5226</a>.</p>
|
|
<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’ll need the following configuration in your <code>config.toml</code>:</p>
|
|
<div class="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 branch bundle links by default to make the page be servable from the file system. If you don’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>config.toml</code></p>
|
|
<div class="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>If you want to use the search feature from the file system using 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="#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 the same <code>config.toml</code> file.</p>
|
|
<div class="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">"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><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>config.toml</code> file.</p>
|
|
<div class="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">"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 class="s2">"SEARCHPAGE"</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’s search box .</p>
|
|
<p>
|
|
|
|
<a href="#image-33a07d28596a582fc824f7d4e665eadd" class="lightbox-link">
|
|
<img src="../../basics/configuration/search_page.png?&width=60pc" alt="Screenshot of the dedicated search page" style="height: auto; width: 60pc;" loading="lazy">
|
|
</a>
|
|
<a href="javascript:history.back();" class="lightbox" id="image-33a07d28596a582fc824f7d4e665eadd">
|
|
<img src="../../basics/configuration/search_page.png?&width=60pc" alt="Screenshot of the dedicated search page" class="lightbox-image" loading="lazy">
|
|
</a></p>
|
|
<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>config.toml</code> as seen below:</p>
|
|
<div class="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">"HTML"</span><span class="p">,</span> <span class="s2">"RSS"</span><span class="p">,</span> <span class="s2">"PRINT"</span><span class="p">,</span> <span class="s2">"SEARCH"</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">"HTML"</span><span class="p">,</span> <span class="s2">"RSS"</span><span class="p">,</span> <span class="s2">"PRINT"</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">"HTML"</span><span class="p">,</span> <span class="s2">"RSS"</span><span class="p">,</span> <span class="s2">"PRINT"</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’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’s URL handling</a> even if you’ve set <code>uglyURLs=true</code> in your <code>config.toml</code>. This is due to the fact that for one mime type only one suffix can be configured.</p>
|
|
<p>Nevertheless, if you’re unhappy with the resulting URLs you can manually redefine <code>outputFormats.PRINT</code> in your own <code>config.toml</code> to your liking.</p>
|
|
</div>
|
|
</div>
|
|
<h2 id="mathjax">MathJax</h2>
|
|
<p>The MathJax configuration parameters can also be set on a specific page. In this case, the global parameter would be overwritten by the local one. See <a href="../../shortcodes/math/">Math</a> for additional documentation.</p>
|
|
<h3 id="math-example">Example</h3>
|
|
<p>MathJax is globally disabled. By default it won’t be loaded by any page.</p>
|
|
<p>On page “Physics” you coded some JavaScript for a dynamic formulae. You can set the MathJax parameters locally to load mathJax on this page.</p>
|
|
<p>You also can disable MathJax for specific pages while globally enabled.</p>
|
|
<h2 id="mermaid">Mermaid</h2>
|
|
<p>The Mermaid configuration parameters can also be set on a specific page. In this case, the global parameter would be overwritten by the local one. See <a href="../../shortcodes/mermaid/">Mermaid</a> for additional documentation.</p>
|
|
<h3 id="mermaid-example">Example</h3>
|
|
<p>Mermaid is globally disabled. By default it won’t be loaded by any page.</p>
|
|
<p>On page “Architecture” you coded some JavaScript to dynamically generate a class diagram. You can set the Mermaid parameters locally to load mermaid on this page.</p>
|
|
<p>You also can disable Mermaid for specific pages while globally enabled.</p>
|
|
<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 two parameters for the defined languages:</p>
|
|
<div class="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="nx">landingPageName</span> <span class="p">=</span> <span class="s2">"<i class='fas fa-home'></i> Home"</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="nx">landingPageName</span> <span class="p">=</span> <span class="s2">"<i class='fas fa-home'></i> Arrr! Homme"</span>
|
|
</span></span><span class="line"><span class="cl"><span class="p">...</span>
|
|
</span></span></code></pre></div><p>If those params are not configured for a specific language, they will get their
|
|
default values:</p>
|
|
<div class="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">"<i class='fas fa-home'></i> Home"</span>
|
|
</span></span></code></pre></div><p>The home button is going to look like this:</p>
|
|
<p>
|
|
|
|
<a href="#image-594b1443884d3e84263d3feebd80e7db" class="lightbox-link">
|
|
<img src="../../basics/configuration/home_button_defaults.png?classes=shadow&width=18.75rem" alt="Default Home Button" class="shadow" style="height: auto; width: 18.75rem;" loading="lazy">
|
|
</a>
|
|
<a href="javascript:history.back();" class="lightbox" id="image-594b1443884d3e84263d3feebd80e7db">
|
|
<img src="../../basics/configuration/home_button_defaults.png?classes=shadow&width=18.75rem" alt="Default Home Button" class="lightbox-image" loading="lazy">
|
|
</a></p>
|
|
|
|
<footer class="footline">
|
|
</footer>
|
|
</article>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
<script src="../../js/clipboard.min.js?1676407395" defer></script>
|
|
<script src="../../js/perfect-scrollbar.min.js?1676407395" defer></script>
|
|
<script src="../../js/theme.js?1676407395" defer></script>
|
|
</body>
|
|
</html>
|