mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-12-17 19:33:30 +00:00
469 lines
33 KiB
HTML
469 lines
33 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.122.0">
|
|
<meta name="generator" content="Relearn 5.23.2+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="Branding :: Hugo Relearn Theme">
|
|
<meta name="twitter:description" content="Documentation for Hugo Relearn Theme">
|
|
<meta property="og:title" content="Branding :: 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/branding/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>Branding :: Hugo Relearn Theme</title>
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/branding/index.html" rel="alternate" hreflang="x-default">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/branding/index.html" rel="alternate" hreflang="en">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/pir/basics/branding/index.html" rel="alternate" hreflang="art-pir">
|
|
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/branding/index.html" rel="canonical" type="text/html" title="Branding :: Hugo Relearn Theme">
|
|
<link href="../../basics/branding/index.xml" rel="alternate" type="application/rss+xml" title="Branding :: Hugo Relearn Theme">
|
|
<link href="../../images/logo.svg?1707773531" 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?1707773532" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fontawesome-all.min.css?1707773532" rel="stylesheet"></noscript>
|
|
<link href="../../css/nucleus.css?1707773532" rel="stylesheet">
|
|
<link href="../../css/auto-complete.css?1707773532" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/auto-complete.css?1707773532" rel="stylesheet"></noscript>
|
|
<link href="../../css/perfect-scrollbar.min.css?1707773532" rel="stylesheet">
|
|
<link href="../../css/fonts.css?1707773532" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fonts.css?1707773532" rel="stylesheet"></noscript>
|
|
<link href="../../css/theme.css?1707773532" rel="stylesheet">
|
|
<link href="../../css/theme-relearn-auto.css?1707773532" rel="stylesheet" id="R-variant-style">
|
|
<link href="../../css/chroma-relearn-auto.css?1707773532" rel="stylesheet" id="R-variant-chroma-style">
|
|
<link href="../../css/variant.css?1707773532" rel="stylesheet">
|
|
<link href="../../css/print.css?1707773532" rel="stylesheet" media="print">
|
|
<link href="../../css/format-print.css?1707773532" rel="stylesheet">
|
|
<link href="../../css/ie.css?1707773532" rel="stylesheet">
|
|
<script src="../../js/url.js?1707773532"></script>
|
|
<script src="../../js/variant.js?1707773532"></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(/\/$/, '');
|
|
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="../../basics/branding/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+ALT+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="../../basics/index.html"><span itemprop="name">Basics</span></a><meta itemprop="position" content="1"> > </li><li
|
|
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Branding</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="branding">Branding</h1>
|
|
|
|
<p>The Relearn theme provides configuration options to change your your site’s colors, favicon and logo. This allows you to easily align your site visuals to your desired style. Most of these options are exposed thru so called color variants.</p>
|
|
<p>A color variant lets you customize various visual effects of your site like almost any color, used fonts, color schemes of print, syntax highligtning, Mermaid and the OpenAPI shortcode, etc. It contains of a CSS file and optional configuration options in your <code>hugo.toml</code>.</p>
|
|
<p>The Relearn theme ships with a wide set of different color variants. You can use them as-is, copy them over and use them as a starting point for your customizations or just create completely new variants unique to your site. The <a href="../../basics/generator/index.html">interactive variant generator</a> may help you with this task.</p>
|
|
<p>Once configured in your <code>hugo.toml</code>, you can select them with the variant selector at the bottom of the menu.</p>
|
|
<h2 id="theme-variant">Change the Variant (Simple)</h2>
|
|
<h3 id="single-variant">Single Variant</h3>
|
|
<p>Set the <code>themeVariant</code> value to the name of your theme file. That’s it! Your site will be displayed in this variant only.</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="69a6238b7bddbebce50b2264d7fb202f">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('69a6238b7bddbebce50b2264d7fb202f','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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">themeVariant</span> <span class="p">=</span> <span class="s2">"relearn-light"</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</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>Your theme variant file must reside in your site’s <code>static/css</code> directory or in the theme’s <code>static/css</code> directory and the file name must start with <code>theme-</code> and end wit <code>.css</code>. In the above example, the path of your theme file must be <code>static/css/theme-relearn-light.css</code>.</p>
|
|
<p>If you want to make changes to a shipped color variant, create a copy in your site’s <code>static/css</code> directory. Don’t edit the file in the theme’s directory!</p>
|
|
</div>
|
|
</div>
|
|
<h3 id="multiple-variants">Multiple Variants</h3>
|
|
<p>You can also set multiple variants. In this case, the first variant is the default chosen on first view and a variant selector will be shown in the menu footer if the array contains more than one entry.</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="77e65d3fe8aaed6a919397854e48fe9e">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('77e65d3fe8aaed6a919397854e48fe9e','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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">themeVariant</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"relearn-light"</span><span class="p">,</span> <span class="s2">"relearn-dark"</span> <span class="p">]</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box notices cstyle tip">
|
|
<div class="box-label"><i class="fa-fw fas fa-lightbulb"></i> Tip</div>
|
|
<div class="box-content">
|
|
|
|
<p>The theme provides an advanced configuration mode, combining the functionality for multiple variants with the below possibilities of adjusting to your OS settings, logo and syntax highlightning and even more!</p>
|
|
<p>Although all options documented here are still working, the advanced configuration options are the recommended way to configure your color variants. <a href="#theme-variant-advanced">See below</a>.</p>
|
|
</div>
|
|
</div>
|
|
<h2 id="adjust-to-os-settings">Adjust to OS Settings</h2>
|
|
<p>You can also cause the site to adjust to your OS settings for light/dark mode. Just set the <code>themeVariant</code> to <code>auto</code> to become an auto mode variant. That’s it.</p>
|
|
<p>You can use the <code>auto</code> value with the single or multiple variants option. If you are using multiple variants, you can drop <code>auto</code> at any position in the option’s array, but usually it makes sense to set it in the first position and make it the default.</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="edf96279a533c86fd03a3a7775cc0ea3">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('edf96279a533c86fd03a3a7775cc0ea3','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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">themeVariant</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"auto"</span><span class="p">,</span> <span class="s2">"red"</span> <span class="p">]</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><p>If you don’t configure anything else, the theme will default to use <code>relearn-light</code> for light mode and <code>relearn-dark</code> for dark mode. These defaults are overwritten by the first two non-auto options of your <code>themeVariant</code> option if present.</p>
|
|
<p>In the above example, you would end with <code>red</code> for light mode and the default of <code>relearn-dark</code> for dark mode.</p>
|
|
<p>If you don’t like that behavior, you can explicitly set <code>themeVariantAuto</code>. The first entry in the array is the color variant for light mode, the second for dark mode.</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="d82a059dabb260cecd73b33507bb14b8">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('d82a059dabb260cecd73b33507bb14b8','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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">themeVariantAuto</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"learn"</span><span class="p">,</span> <span class="s2">"neon"</span> <span class="p">]</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><h2 id="change-the-favicon">Change the Favicon</h2>
|
|
<p>If your favicon is a SVG, PNG or ICO, just drop your image in your site’s <code>static/images/</code> directory and name it <code>favicon.svg</code>, <code>favicon.png</code> or <code>favicon.ico</code> respectively.</p>
|
|
<p>If you want to adjust your favicon according to your OS settings for light/dark mode, add the image files <code>static/images/favicon-light.svg</code> and <code>static/images/favicon-dark.svg</code> to your site’s directory, respectively, corresponding to your file format. In case some of the files are missing, the theme falls back to <code>favicon.svg</code> for each missing file. All supplied favicons must be of the same file format.</p>
|
|
<p>If no favicon file is found, the theme will lookup the alternative filename <code>logo</code> in the same location and will repeat the search for the list of supported file types.</p>
|
|
<p>If you need to change this default behavior, create a new file <code>layouts/partials/favicon.html</code> in your site’s directory and write something like this:</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="47bd8993a76b50e9d204bd60f657e296">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="layoutspartialsfaviconhtml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('47bd8993a76b50e9d204bd60f657e296','layoutspartialsfaviconhtml')"
|
|
>
|
|
<span class="tab-nav-text">layouts/partials/favicon.html</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="layoutspartialsfaviconhtml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"icon"</span> <span class="na">href</span><span class="o">=</span><span class="s">"/images/favicon.bmp"</span> <span class="na">type</span><span class="o">=</span><span class="s">"image/bmp"</span><span class="p">></span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><h2 id="change-the-logo">Change the Logo</h2>
|
|
<p>Create a new file in <code>layouts/partials/logo.html</code> of your site. Then write any HTML you want. You could use an <code>img</code> HTML tag and reference an image created under the <em>static</em> folder, or you could paste a SVG definition!</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 size of the logo will adapt automatically.</p>
|
|
</div>
|
|
</div>
|
|
<h2 id="syntax-highlightning">Syntax Highlightning</h2>
|
|
<p>If you want to switch the syntax highlighting theme together with your color variant, you need to configure your installation <a href="https://gohugo.io/content-management/syntax-highlighting/" target="_blank">according to Hugo’s documentation</a> and provide a syntax highlighting stylesheet file.</p>
|
|
<p>You can use a one of the shipped stylesheet files or use Hugo to generate a file for you. The file must be written to <code>static/css/chroma-<NAME>.css</code>. To use it with your color variant you have to define <code>--CODE-theme: <NAME></code> in the color variant stylesheet file.</p>
|
|
<p>For an example, take a look into <a href="https://github.com/McShelby/hugo-theme-relearn/blob/main/static/css/theme-relearn-light.css" target="_blank"><code>theme-relearn-light.css</code></a> and <a href="https://github.com/McShelby/hugo-theme-relearn/blob/main/exampleSite/config/_default/hugo.toml" target="_blank"><code>hugo.toml</code></a> of the exampleSite.</p>
|
|
<h2 id="theme-variant-advanced">Change the Variant (Advanced)</h2>
|
|
<p>The theme offers a new way to configure theme variants and all of the aspects above inside of a single configuration item. This comes with some features previously unsupported.</p>
|
|
<p>Like with the <a href="#multiple-variants">multiple variants</a> option, you are defining your theme variants in an array but now <em>not by simple strings</em> <strong>but in a table with suboptions</strong>.</p>
|
|
<p>Again, in this case, the first variant is the default chosen on first view and a variant selector will be shown in the menu footer if the array contains more than one entry.</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="bcf4270639c01ca85900e3a291bec7ab">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('bcf4270639c01ca85900e3a291bec7ab','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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">themeVariant</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"relearn-light"</span><span class="p">,</span> <span class="s2">"relearn-dark"</span> <span class="p">]</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><p>you now write it that way:</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="824e9d6974894aafbc886fd6ab93649d">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('824e9d6974894aafbc886fd6ab93649d','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"relearn-light"</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">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"relearn-dark"</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><p>The <code>identifier</code> option is mandatory and equivalent to the string in the first example. Further options can be configured, see the table below.</p>
|
|
<h3 id="parameter">Parameter</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Default</th>
|
|
<th>Notes</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>identifier</td>
|
|
<td><em><empty></em></td>
|
|
<td>Must correspond to the name of a color variant either in your site’s or the theme’s directory in the form <code>static/css/theme-<IDENTIFIER>.css</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>name</td>
|
|
<td>see notes</td>
|
|
<td>The name to be displayed in the variant selector. If not set, the identifier is used in a human readable form.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>auto</td>
|
|
<td><em><empty></em></td>
|
|
<td>If set, the variant is treated as an <a href="#adjust-to-os-settings">auto mode variant</a>. It has the same behavior as the <code>themeVariantAuto</code> option. The first entry in the array is the color variant for light mode, the second for dark mode. Defining auto mode variants with the advanced options has the benefit that you can now have multiple auto mode variants instead of just one with the simple options.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="example-configuration-of-this-site">Example Configuration of This Site</h3>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="c5ec5294d67c927ba3a12d1869f09c81">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('c5ec5294d67c927ba3a12d1869f09c81','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"relearn-auto"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">name</span> <span class="p">=</span> <span class="s2">"Relearn Light/Dark"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">auto</span> <span class="p">=</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">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"relearn-light"</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">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"relearn-dark"</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">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"zen-auto"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">name</span> <span class="p">=</span> <span class="s2">"Zen Light/Dark"</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">auto</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">"zen-light"</span><span class="p">,</span> <span class="s2">"zen-dark"</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">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"zen-light"</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">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"zen-dark"</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">themeVariant</span><span class="p">]]</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">"neon"</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><h2 id="modify-shipped-variants">Modify Shipped Variants</h2>
|
|
<p>In case you like a shipped variant but only want to tweak some aspects, you have two choices:</p>
|
|
<ol>
|
|
<li>
|
|
<p>Copy and change</p>
|
|
<p>You can copy the shipped variant file from the theme’s <code>static/css</code> directory to the site’s <code>static/css</code> directory and either store it with the same name or give it a new name. Edit the settings and save the new file. Afterwards you can use it in your <code>hugo.toml</code> by the choosen name.</p>
|
|
</li>
|
|
<li>
|
|
<p>Create and import</p>
|
|
<p>You can create a new variant file in the site’s <code>static/css</code> directory and give it a new name. Import the shipped variant, add the settings you want to change and save the new file. Afterwards you can use it in your <code>hugo.toml</code> by the choosen name.</p>
|
|
<p>For example, you want to use the <code>relearn-light</code> variant but want to change the syntax highlightning schema to the one used in the <code>neon</code> variant. For that, create a new <code>static/css/theme-my-branding.css</code> in your site’s directory and add the following lines:</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="7e1ade44f211c8d27017605394b4a605">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="staticcsstheme-my-brandingcss"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('7e1ade44f211c8d27017605394b4a605','staticcsstheme-my-brandingcss')"
|
|
>
|
|
<span class="tab-nav-text">static/css/theme-my-branding.css</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="staticcsstheme-my-brandingcss"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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="k">import</span> <span class="s2">"theme-relearn-light.css"</span><span class="p">;</span>
|
|
</span></span><span class="line"><span class="cl">
|
|
</span></span><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">--CODE-theme</span><span class="p">:</span> <span class="n">neon</span><span class="p">;</span> <span class="c">/* name of the chroma stylesheet file */</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nv">--CODE-BLOCK-color</span><span class="p">:</span> <span class="nb">rgba</span><span class="p">(</span> <span class="mi">226</span><span class="p">,</span> <span class="mi">228</span><span class="p">,</span> <span class="mi">229</span><span class="p">,</span> <span class="mi">1</span> <span class="p">);</span> <span class="c">/* fallback color for code text */</span>
|
|
</span></span><span class="line"><span class="cl"> <span class="nv">--CODE-BLOCK-BG-color</span><span class="p">:</span> <span class="nb">rgba</span><span class="p">(</span> <span class="mi">40</span><span class="p">,</span> <span class="mi">42</span><span class="p">,</span> <span class="mi">54</span><span class="p">,</span> <span class="mi">1</span> <span class="p">);</span> <span class="c">/* fallback color for code background */</span>
|
|
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><p>Afterwards put this in your <code>hugo.toml</code> to use your new variant:</p>
|
|
|
|
|
|
<div class="tab-panel" data-tab-group="d144f5ec64f4a0da979fb57d061e9158">
|
|
<div class="tab-nav">
|
|
<div class="tab-nav-title">​</div>
|
|
<button
|
|
data-tab-item="hugotoml"
|
|
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
|
|
onclick="switchTab('d144f5ec64f4a0da979fb57d061e9158','hugotoml')"
|
|
>
|
|
<span class="tab-nav-text">hugo.toml</span>
|
|
</button>
|
|
</div>
|
|
<div class="tab-content-container">
|
|
<div
|
|
data-tab-item="hugotoml"
|
|
class="tab-content tab-panel-style cstyle initial active">
|
|
<div class="tab-content-text">
|
|
|
|
<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">themeVariant</span> <span class="p">=</span> <span class="s2">"my-branding"</span></span></span></code></pre></div></div>
|
|
</div>
|
|
</div>
|
|
</div><p>In comparison to <em>copy and change</em>, this has the advantage that you profit from any adjustments to the <code>relearn-light</code> variant but keep your modifications.</p>
|
|
</li>
|
|
</ol>
|
|
|
|
<footer class="footline">
|
|
<div class=" taxonomy-categories term-list cstyle " title="Categories" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
|
|
<i class="fa-fw fas fa-layer-group"></i>
|
|
<ul>
|
|
<li><a class="term-link" href="../../categories/custom/index.html">custom</a></li>
|
|
<li><a class="term-link" href="../../categories/theming/index.html">theming</a></li>
|
|
</ul>
|
|
</div>
|
|
</footer>
|
|
</article>
|
|
|
|
</div>
|
|
</main>
|
|
</div>
|
|
<script src="../../js/clipboard.min.js?1707773532" defer></script>
|
|
<script src="../../js/perfect-scrollbar.min.js?1707773532" defer></script>
|
|
<script src="../../js/theme.js?1707773532" defer></script>
|
|
</body>
|
|
</html>
|