mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 09:43:06 +00:00
228 lines
23 KiB
HTML
228 lines
23 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.120.4">
|
|
<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="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?1700697951" 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?1700697952" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fontawesome-all.min.css?1700697952" rel="stylesheet"></noscript>
|
|
<link href="../../css/nucleus.css?1700697952" rel="stylesheet">
|
|
<link href="../../css/auto-complete.css?1700697952" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/auto-complete.css?1700697952" rel="stylesheet"></noscript>
|
|
<link href="../../css/perfect-scrollbar.min.css?1700697952" rel="stylesheet">
|
|
<link href="../../css/fonts.css?1700697952" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fonts.css?1700697952" rel="stylesheet"></noscript>
|
|
<link href="../../css/theme.css?1700697952" rel="stylesheet">
|
|
<link href="../../css/theme-relearn-auto.css?1700697952" rel="stylesheet" id="R-variant-style">
|
|
<link href="../../css/variant.css?1700697952" rel="stylesheet">
|
|
<link href="../../css/print.css?1700697952" rel="stylesheet" media="print">
|
|
<link href="../../css/format-print.css?1700697952" rel="stylesheet">
|
|
<link href="../../css/ie.css?1700697952" rel="stylesheet">
|
|
<script src="../../js/url.js?1700697952"></script>
|
|
<script src="../../js/variant.js?1700697952"></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.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>config.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>config.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="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 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="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 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="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><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="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><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="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><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, generate a syntax highlighting stylesheet and configure your installation <a href="https://gohugo.io/content-management/syntax-highlighting/" target="_blank">according to Hugo’s documentation</a>. Then, <code>@import</code> the syntax highlightning stylesheet in your color variant stylesheet.</p>
|
|
<p>For an example, take a look into <code>theme-relearn-light.css</code> and <code>config.toml</code> of the exampleSite.</p>
|
|
<p>If you want to reconfigure just the syntax highlighting of an existing color variant, you need to copy the file to your site’s directory and adjust it accordingly.</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="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><p>you now write it that way:</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="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><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="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>
|
|
<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?1700697952" defer></script>
|
|
<script src="../../js/perfect-scrollbar.min.js?1700697952" defer></script>
|
|
<script src="../../js/theme.js?1700697952" defer></script>
|
|
</body>
|
|
</html>
|