2022-04-02 13:30:16 +00:00
<!DOCTYPE html>
2022-11-01 01:10:49 +00:00
< html lang = "en" dir = "ltr" >
2022-04-02 13:30:16 +00:00
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0" >
2022-12-08 10:17:57 +00:00
< meta name = "generator" content = "Hugo 0.108.0" >
2022-12-11 22:22:02 +00:00
< meta name = "generator" content = "Relearn 5.8.1+tip" >
2022-04-02 13:30:16 +00:00
< meta name = "description" content = "Documentation for Hugo Relearn Theme" >
< meta name = "author" content = "Sören Weber" >
< title > Customization :: Hugo Relearn Theme< / title >
2022-11-15 06:35:08 +00:00
< link href = "https://McShelby.github.io/hugo-theme-relearn/basics/customization/index.html" rel = "canonical" type = "text/html" title = "Customization :: Hugo Relearn Theme" >
2022-11-06 00:38:34 +00:00
< link href = "../../basics/customization/index.xml" rel = "alternate" type = "application/rss+xml" title = "Customization :: Hugo Relearn Theme" >
2022-12-16 16:18:42 +00:00
< link href = "../../images/logo.svg?1671207516" rel = "icon" type = "image/svg+xml" >
2022-07-15 13:20:02 +00:00
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how - to - use -->
2022-12-16 16:18:42 +00:00
< link href = "../../css/fontawesome-all.min.css?1671207517" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "../../css/fontawesome-all.min.css?1671207517" rel = "stylesheet" > < / noscript >
< link href = "../../css/featherlight.min.css?1671207517" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "../../css/featherlight.min.css?1671207517" rel = "stylesheet" > < / noscript >
< link href = "../../css/auto-complete.css?1671207517" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "../../css/auto-complete.css?1671207517" rel = "stylesheet" > < / noscript >
< link href = "../../css/perfect-scrollbar.min.css?1671207517" rel = "stylesheet" >
< link href = "../../css/nucleus.css?1671207517" rel = "stylesheet" >
< link href = "../../css/fonts.css?1671207517" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "../../css/fonts.css?1671207517" rel = "stylesheet" > < / noscript >
< link href = "../../css/theme.css?1671207517" rel = "stylesheet" >
< link href = "../../css/theme-relearn-light.css?1671207517" rel = "stylesheet" id = "variant-style" >
< link href = "../../css/ie.css?1671207517" rel = "stylesheet" >
< link href = "../../css/variant.css?1671207517" rel = "stylesheet" >
< link href = "../../css/print.css?1671207517" rel = "stylesheet" media = "print" >
< link href = "../../css/format-print.css?1671207517" rel = "stylesheet" >
< script src = "../../js/url.js?1671207517" > < / script >
< script src = "../../js/variant.js?1671207517" > < / script >
2022-04-02 13:30:16 +00:00
< 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
2022-11-05 23:35:48 +00:00
window.index_js_url="../../index.search.js";
var root_url="../../";
2022-04-02 13:30:16 +00:00
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!';
2022-11-17 21:13:11 +00:00
window.T_No_results_found = 'No results found for \u0022{0}\u0022';
window.T_N_results_found = '{1} results found for \u0022{0}\u0022';
2022-04-02 13:30:16 +00:00
// some further base stuff
var baseUriFull='https:\/\/McShelby.github.io\/hugo-theme-relearn/';
2022-07-14 20:20:11 +00:00
window.variants & & variants.init( [ 'relearn-light', 'relearn-dark', 'learn', 'neon', 'blue', 'green', 'red' ] );
2022-04-02 13:30:16 +00:00
< / script >
2022-12-16 16:18:42 +00:00
< script src = "../../js/jquery.min.js?1671207517" defer > < / script >
2022-12-02 15:05:54 +00:00
< style >
#body img.bg-white {
background-color: white;
}
< / style >
2022-04-02 13:30:16 +00:00
< / head >
2022-11-15 06:35:08 +00:00
< body class = "mobile-support print disableInlineCopyToClipboard" data-url = "../../basics/customization/index.html" >
2022-04-02 13:30:16 +00:00
< div id = "body" class = "default-animation" >
< div id = "sidebar-overlay" > < / div >
< div id = "toc-overlay" > < / div >
2022-11-07 19:58:08 +00:00
< nav id = "topbar" class = "highlightable" dir = "ltr" >
2022-04-02 13:30:16 +00:00
< div >
< div id = "breadcrumbs" >
< span id = "sidebar-toggle-span" >
2022-10-08 20:51:04 +00:00
< a href = "#" id = "sidebar-toggle" title = 'Menu (CTRL+ALT+n)' > < i class = "fas fa-bars fa-fw" > < / i > < / a >
2022-04-02 13:30:16 +00:00
< / span >
< ol class = "links" itemscope itemtype = "http://schema.org/BreadcrumbList" >
2022-11-05 23:35:48 +00:00
< 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 >
2022-10-02 22:25:49 +00:00
< li itemscope itemtype = "https://schema.org/ListItem" itemprop = "itemListElement" > < span itemprop = "name" > Customization< / span > < meta itemprop = "position" content = "3" > < / li >
2022-04-02 13:30:16 +00:00
< / ol >
< / div >
< / div >
< / nav >
2022-07-05 22:16:52 +00:00
< main id = "body-inner" class = "highlightable default" tabindex = "-1" >
2022-04-02 13:30:16 +00:00
< div class = "flex-block-wrapper" >
< div id = "head-tags" >
< / div >
2022-11-07 19:58:08 +00:00
< article class = "default" >
2022-11-13 21:34:47 +00:00
< h1 id = "customization" > Customization< / h1 >
2022-07-05 22:16:52 +00:00
2022-12-16 16:18:42 +00:00
< 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" rel = "noopener" >
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’ t change the code directly. Instead
< a href = "https://gohugo.io/themes/customizing/" target = "_blank" rel = "noopener" >
follow this page
< / a > . You’ d create a new partial in the < code > layouts/partials< / code > folder of your local project. This partial will have the priority.< / p >
2022-04-02 13:30:16 +00:00
< p > This theme defines the following partials :< / p >
< ul >
2022-12-16 16:18:42 +00:00
< li > < code > header.html< / code > : the header of the page. See
< a href = "#output-formats" >
output-formats
< / a > < / li >
< li > < code > footer.html< / code > : the footer of the page. See
< a href = "#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 = "#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 = "#output-formats" >
output-formats
< / a > < / li >
2022-04-02 13:30:16 +00:00
< 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’ t forget to include < code > style< / code > HTML tag directive in your file.< / li >
2022-10-31 14:06:51 +00:00
< li > < code > custom-footer.html< / code > : custom footer in page. Meant to be overwritten when adding JavaScript. Don’ t forget to include < code > javascript< / code > HTML tag directive in your file.< / li >
2022-04-02 13:30:16 +00:00
< li > < code > favicon.html< / code > : the favicon< / li >
2022-10-31 14:06:51 +00:00
< 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’ 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’ s < code > headingPost< / code > setting into account.< / li >
2022-04-02 13:30:16 +00:00
< 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 >
2022-10-31 14:06:51 +00:00
< 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’ 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’ s < code > menuPost< / code > setting into account.< / li >
2022-04-02 13:30:16 +00:00
< li > < code > menu-footer.html< / code > : footer of the the left menu< / li >
< li > < code > toc.html< / code > : table of contents< / li >
2022-10-31 14:06:51 +00:00
< li > < code > content.html< / code > : the content page itself. This can be overridden if you want to display page’ s meta data above or below the content.< / li >
2022-04-02 13:30:16 +00:00
< li > < code > content-footer< / code > : footer below the content, has a default implementation but you can overwrite it if you don’ t like it.< / li >
< / ul >
< h2 id = "change-the-logo" > Change the logo< / h2 >
< p > Create a new file in < code > layouts/partials/< / code > named < code > logo.html< / code > . 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 >
2022-05-29 21:00:53 +00:00
< div class = "box notices cstyle note" >
2022-12-01 00:38:08 +00:00
< div class = "box-label" > < i class = "fa-fw fas fa-exclamation-circle" > < / i > Note< / div >
< div class = "box-content" >
2022-04-02 13:30:16 +00:00
< p > The size of the logo will adapt automatically< / p >
2022-12-04 09:16:01 +00:00
< / div >
2022-04-02 13:30:16 +00:00
< / div >
< h2 id = "change-the-favicon" > Change the favicon< / h2 >
2022-10-31 14:06:51 +00:00
< p > If your favicon is a SVG, PNG or ICO, just drop off your image in your local < code > static/images/< / code > folder and name it < code > favicon.svg< / code > , < code > favicon.png< / code > or < code > favicon.ico< / code > respectively.< / p >
2022-04-02 13:30:16 +00:00
< 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 in < code > layouts/partials/< / code > named < code > favicon.html< / code > . Then write something like this:< / p >
2022-10-02 22:25:49 +00:00
< div class = "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 >
2022-04-02 13:30:16 +00:00
< / span > < / span > < / code > < / pre > < / div > < h2 id = "theme-variant" > Change the colors< / h2 >
< p > The Relearn theme lets you choose between some predefined color variants in light or dark mode, but feel free to add one yourself!< / p >
< p > You can preview the shipped variants by changing them in the variant selector at the bottom of the menu.< / p >
< h3 id = "single-variant" > Single variant< / h3 >
< p > Set the < code > themeVariant< / code > value with the name of your theme file. That’ s it!< / 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" > themeVariant< / span > < span class = "p" > =< / span > < span class = "s2" > " relearn-light" < / span >
2022-10-31 14:06:51 +00:00
< / span > < / span > < / code > < / pre > < / div > < p > In the above example your theme file has to be named < code > theme-relearn-light.css< / code > < / p >
2022-04-02 13:30:16 +00:00
< h3 id = "multiple-variants" > Multiple variants< / h3 >
2022-10-31 14:06:51 +00:00
< p > You can also set multiple variants. In this case, the first variant is the default chosen on first view and a variant switch will be shown in the menu footer.< / p >
2022-04-02 13:30:16 +00:00
< 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" > # Change default color scheme with a variant one.< / 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 >
2022-05-29 21:00:53 +00:00
< div class = "box notices cstyle tip" >
2022-12-01 00:38:08 +00:00
< div class = "box-label" > < i class = "fa-fw fas fa-lightbulb" > < / i > Tip< / div >
< div class = "box-content" >
2022-12-16 16:18:42 +00:00
< 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" rel = "noopener" >
according to Hugo’ s documentation
< / a > , and < code > @import< / code > this stylesheet in your color variant stylesheet. For an example, take a look into < code > theme-relearn-light.css< / code > and < code > config.toml< / code > of the exampleSite.< / p >
2022-12-04 09:16:01 +00:00
< / div >
2022-04-02 13:30:16 +00:00
< / div >
< h3 id = "roll-your-own" > Roll your own< / h3 >
2022-12-16 16:18:42 +00:00
< p > If you are not happy with the shipped variants you can either copy and rename one of the shipped files from < code > themes/hugo-theme-relearn/static/css< / code > to < code > static/css< / code > , edit them afterwards to your liking in a text editor and configure the < code > themeVariant< / code > parameter in your < code > config.toml< / code > or just use the
< a href = "../../basics/generator/" >
interactive variant generator
< / a > .< / p >
2022-07-14 20:20:11 +00:00
< h3 id = "output-formats" > Output formats< / h3 >
2022-12-16 16:18:42 +00:00
< p > Certain parts of the theme can be changed for support of your own
< a href = "https://gohugo.io/templates/output-formats/" target = "_blank" rel = "noopener" >
output formats
< / a > . Eg. if you define a new output format < code > PLAINTEXT< / code > in your < code > config.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 >
2022-04-02 13:30:16 +00:00
< footer class = "footline" >
< / footer >
< / article >
< / div >
< / main >
< / div >
2022-12-16 16:18:42 +00:00
< script src = "../../js/clipboard.min.js?1671207518" defer > < / script >
< script src = "../../js/perfect-scrollbar.min.js?1671207518" defer > < / script >
< script src = "../../js/featherlight.min.js?1671207518" defer > < / script >
< script src = "../../js/theme.js?1671207518" defer > < / script >
2022-04-02 13:30:16 +00:00
< / body >
< / html >