<linkhref="https://McShelby.github.io/hugo-theme-relearn/basics/migration/index.html"rel="canonical"type="text/html"title="What's new :: Hugo Relearn Theme">
<p>This document shows you what’s new in the latest release. For a detailed list of changes, see the <ahref="../../basics/history/">history page</a>.</p>
<p><strong>New</strong>: This release introduces an additional dedicated search page. On this page, displayed search results have more space making it easier scanning thru large number of results.</p>
<p>To activate this feature, you need to <ahref="../../basics/configuration/#activate-dedicated-search-page">configure it</a> in your <code>config.toml</code> as a new outputformat <code>SEARCHPAGE</code> for the home page. If you don’t configure it, no dedicated search page will be accessible and the theme works as before.</p>
<p>You can access the search page by either clicking on the magnifier glass or pressing enter inside of the search box.</p>
</li>
<li>
<p><strong>New</strong>: Keyboard handling for the TOC and search was improved.</p>
<p>Pressing <code>CTRL+ALT+t</code> now will not only toggle the TOC overlay but also places the focus to the first heading on opening. Subsequently this makes it possible to easily select headings by using the <code>TAB</code> key.</p>
<p>The search received its own brand new keyboard shortcut <code>CTRL+ALT+f</code>. This will focus the cursor inside of the the search box so you can immediately start your search by typing.</p>
</li>
<li>
<p><strong>New</strong>: You are now able to turn off the generation of generator meta tags in your HTML head to hide the used versions of Hugo and this theme.</p>
<p>To <ahref="../../basics/configuration/#global-site-parameters">configure this</a> in your <code>config.toml</code> make sure to set Hugo’s <code>disableHugoGeneratorInject=true</code><strong>and</strong> also <code>[params] disableGeneratorVersion=true</code>, otherwise Hugo will generate a meta tag into your home page automagically.</p>
</li>
<li>
<p><strong>New</strong>: Creation of your project gets a little bit faster with this release.</p>
<p>This addresses increased build time with the 5.x releases. The theme now heavily caches partial results leading to improved performance. To further increase performance, unnecessary parts of the page are now skipped for creation of the print output (eg. menus, navigation bar, etc.).</p>
<p><strong>Change</strong>: The way images are processed has changed. Now images are lazy loaded by default which speeds up page load on slow networks and/or big pages and also the print preview.</p>
<p>For that the JavaScript code to handle the <ahref="../../cont/markdown/#further-image-formatting">lightbox and image effects</a> on the client side was removed in favour for static generation of those effects on the server.</p>
<p>If you have used HTML directly in your Markdown files, this now has the downside that it doesn’t respect the effect query parameter anymore. In this case you have to migrate all your HTML <code>img</code> URLs manually to the respective HTML attributes.</p>
<p><strong>Change</strong>: <ahref="../../basics/configuration/#serving-your-page-from-the-filesystem">With the proper settings</a> in your <code>config.toml</code> your page is now servable from the local file system using <code>file://</code> URLs.</p>
<p>Please note that the searchbox will only work for this if you reconfigure your outputformat for the homepage in your <code>config.toml</code> from <code>JSON</code> to <code>SEARCH</code>. The now deprecated <code>JSON</code> outputformat still works as before, so there is no need to reconfigure your installation if it is only served from <code>http://</code> or <code>https://</code>.</p>
<p><strong>Change</strong>: The <ahref="../../shortcodes/button/"><code>button</code> shortcode</a> has a new parameter <code>target</code> to set the destination frame/window for the URL to open. If not given, it defaults to a new window/tab for external URLs or is not set at all for internal URLs. Previously even internal URLs where opened in a new window/tab.</p>
<p><strong>New</strong>: The <ahref="../../shortcodes/math/"><code>math</code> shortcode</a> and <ahref="../../shortcodes/mermaid/"><code>mermaid</code> shortcode</a> now also support the <code>align</code> parameter if codefence syntax is used.</p>
<p><strong>New</strong>: Support for languages that are written right to left (like Arabic). This is only implemented for the content area but not the navigation sidebar. This feature is not available in Internet Explorer 11.</p>
<p><strong>Change</strong>: In the effort to comply with WCAG standards, the implementation of the collapsible menu was changed. Although the functionality of the new implementation works with old browsers (Internet Explorer 11), the display of the expander icons does not and is limited to modern browsers.</p>
<p><strong>New</strong>: <ahref="../../cont/markdown/#add-css-classes">Image formatting</a> has two new classes to align images to the <code>left</code> or <code>right</code>. Additionally, the already existing <code>inline</code> option is now documented.</p>
<p><strong>New</strong>: Printing for the <ahref="../../shortcodes/swagger/"><code>swagger</code> shortcode</a> was optimized to expand sections that are usually closed in interactive mode. This requires <ahref="../../basics/configuration/#activate-print-support">print support</a> to be configured.</p>
<li><strong>Change</strong>: If you’ve set <code>collapsibleMenu = true</code> in your <code>config.toml</code>, the menu will be expanded if a search term is found in a collapsed submenu. The menu will return to its initial collapse state once the search term does not match any submenus.</li>
<p><strong>Change</strong>: Because the print preview URLs were non deterministic for normal pages in comparison to page bundles, this is now changed. Each print preview is now accessible by adding a <code>index.print.html</code> to the default URL.</p>
<p>You can revert this behavior by overwriting the PRINT output format setting in your <code>config.toml</code>to:</p>
<p><strong>Breaking</strong>: The theme changed how JavaScript and CSS dependencies are loaded to provide a better performance. In case you’ve added own JavaScript code that depends on the themes jQuery implementation, you have to put it into a separate <code>*.js</code> file (if not already) and add the <code>defer</code> keyword to the <code>script</code> element. Eg.</p>
<p><strong>Change</strong>: The way <ahref="../../cont/archetypes/">archetypes</a> are used to generate output has changed. The new systems allows you, to redefine existing archetypes or even generate your own ones.</p>
<p>Your existing markdown files will still work like before and therefore you don’t need to change anything after the upgrade. Nevertheless, it is recommended to adapt your existing markdown files to the new way as follows:</p>
<p>for your home page, add the frontmatter parameter <code>archetype = "home"</code> and remove the leading heading</p>
</li>
<li>
<p>for all files containing the deprecated frontmatter parameter <code>chapter = true</code>, replace it with <code>archetype = "chapter"</code> and remove the leading headings</p>
</li>
</ul>
</li>
<li>
<p><strong>Change</strong>: The frontmatter options <code>pre</code> / <code>post</code> were renamed to <code>menuPre</code> / <code>menuPost</code>. The old options will still be used if the new options aren’t set. Therefore you don’t need to change anything after the upgrade.</p>
<p><strong>New</strong>: Adding new partials <code>heading-pre.html</code> / <code>heading-post.html</code> and according frontmatter options <code>headingPre</code> / <code>headingPost</code> to modify the way your page`s main heading gets styled.</p>
<p><strong>New</strong>: The new shortcode <code>math</code> is available to add beautiful math and chemical formulae. See the <ahref="../../shortcodes/math/">documentation</a> for available features. This feature will not work with Internet Explorer 11.</p>
<p><strong>Breaking</strong>: The second parameter for the <ahref="../../shortcodes/include/"><code>include</code> shortcode</a> was switched in meaning and was renamed from <code>showfirstheading</code> to <code>hidefirstheading</code>. If you haven’t used this parameter in your shortcode, the default behavior hasn’t changed and you don’t need to change anything.</p>
<p><strong>Change</strong>: Previously, if the <ahref="../../shortcodes/tabs/"><code>tabs</code> shortcode</a> could not find a tab item because, the tabs ended up empty. Now the first tab is selected instead.</p>
<p><strong>Change</strong>: The <code>landingPageURL</code> was removed from <code>config.toml</code>. You can safely remove this as well from your configuration as it is not used anymore. The theme will detect the landing page URL automatically.</p>
<p><strong>New</strong>: All shortcodes can now be also called from your partials. Examples for this are added to the documentation of each shortcode.</p>
<li><strong>New</strong>: While fixing issues with the search functionality for non Latin languages, you can now <ahref="../../cont/i18n/#search-with-mixed-language-support">configure to have multiple languages on a single page</a>.</li>
<p><strong>Breaking</strong>: The <code>custom_css</code> config parameter was removed from the configuration. If used in an existing installation, it can be achieved by overriding the <code>custom-header.html</code> template in a much more generic manner.</p>
<p><strong>Breaking</strong>: Because anchor hover color was not configurable without introducing more complexity to the variant stylesheets, we decided to remove <code>--MAIN-ANCHOR-color</code> instead. You don’t need to change anything in your custom color stylesheet as the anchors now get their colors from <code>--MAIN-LINK-color</code> and <code>--MAIN-ANCHOR-HOVER-color</code> respectively.</p>
<p><strong>New</strong>: All shortcodes now support named parameter. The positional parameter are still supported but will not be enhanced with new features, so you don’t need to change anything in your installation.</p>
<p>This applies to <ahref="../../shortcodes/expand/"><code>expand</code></a>, <ahref="../../shortcodes/include/"><code>include</code></a>, <ahref="../../shortcodes/notice/"><code>notice</code></a> and <ahref="../../shortcodes/siteparam/"><code>siteparam</code></a>.</p>
<p><strong>New</strong>: The <ahref="../../shortcodes/button/"><code>button</code></a> shortcode received some love and now has a parameter for the color style similar to other shortcodes.</p>
<p><strong>New</strong>: New colors <code>--PRIMARY-color</code> and <code>--SECONDARY-color</code> were added to provide easier modification of your custom style. Shortcodes with a color style can now have <code>primary</code> or <code>secondary</code> as additional values.</p>
<p>These two colors are the default for other, more specific color variables. You don’t need to change anything in your existing custom color stylesheets as those variables get reasonable default values.</p>
<p><strong>Breaking</strong>: If you had previously overwritten the <code>custom-footer.html</code> partial to add visual elements below the content of your page, you have to move this content to the new partial <code>content-footer.html</code>. <code>custom-footer.html</code> was never meant to contain HTML other than additional styles and JavaScript.</p>
<p><strong>New</strong>: If you prefer expandable/collapsible menu items, you can now set <code>collapsibleMenu=true</code> in your <code>config.toml</code>. This will add arrows to all menu items that contain sub menus. The menu will expand/collapse without navigation if you click on an arrow.</p>
<p><strong>New</strong>: You can activate <ahref="../../basics/configuration/#activate-print-support">print support</a> in your <code>config.toml</code> to add the capability to print whole chapters or even the complete site.</p>
<p><strong>New</strong>: Introduction of new CSS variables to set the font. The theme distinguishes between <code>--MAIN-font</code> for all content text and <code>--CODE-font</code> for inline or block code. There are additional overrides for all headings. See the <ahref="../../basics/generator/">theme variant generator</a> of the exampleSite for all available variables.</p>
<p><strong>New</strong>: The new shortcode <code>swagger</code> is available to include a UI for REST OpenAPI Specifications. See the <ahref="../../shortcodes/swagger/">documentation</a> for available features. This feature will not work with Internet Explorer 11.</p>
<p><strong>Change</strong>: In this release the Mermaid JavaScript library will only be loaded on demand if the page contains a Mermaid shortcode or is using Mermaid codefences. This changes the behavior of <code>disableMermaid</code> config option as follows: If a Mermaid shortcode or codefence is found, the option will be ignored and Mermaid will be loaded regardlessly.</p>
<p>The option is still useful in case you are using scripting to set up your graph. In this case no shortcode or codefence is involved and the library is not loaded by default. In this case you can set <code>disableMermaid=false</code> in your frontmatter to force the library to be loaded. See the <ahref="../../basics/generator/">theme variant generator</a> of the exampleSite for an example.</p>
<p><strong>This change requires at least Hugo 0.93.0 to be used</strong>. The minimum requirement will be reported during build on the console if not met.</p>
</li>
<li>
<p><strong>New</strong>: Additional color variant variable <code>--MERMAID-theme</code> to set the variant’s Mermaid theme. This causes the Mermaid theme to switch with the color variant if it defers from the setting of the formerly selected color variant.</p>
<li><strong>New</strong>: <ahref="../../shortcodes/attachments/"><code>attachment</code></a> and <ahref="../../shortcodes/notice/"><code>notice</code></a> shortcodes have a new parameter to override the default icon. Allowed values are all <ahref="https://fontawesome.com/v5/search?m=free">Font Awesome 5 Free</a> icons.</li>
<p><strong>Breaking</strong>: We made changes to the menu footer. If you have your <code>menu-footer.html</code><ahref="../../basics/customization/">partial overridden</a>, you may have to review the styling (eg. margins/paddings) in your partial. For a reference take a look into the <code>menu-footer.html</code> partial that is coming with the exampleSite.</p>
<p>This change was made to allow your own menu footer to be placed right after the so called prefooter that comes with the theme (containing the language switch and <em>Clear history</em> functionality).</p>
</li>
<li>
<p><strong>Breaking</strong>: We have changed the default colors from the original Learn theme (the purple menu header) to the Relearn defaults (the light green menu header) as used in the official documentation.</p>
<p>This change will only affect your installation if you’ve not set the <code>themeVariant</code> parameter in your <code>config.toml</code>. <ahref="../../basics/customization/#theme-variant">If you still want to use the Learn color variant</a>, you have to explicitly set <code>themeVariant="learn"</code> in your <code>config.toml</code>.</p>
<p>Note, that this will also affect your site if viewed with Internet Explorer 11 but in this case it can not be reconfigured as Internet Explorer does not support CSS variables.</p>
<p><strong>Change</strong>: Due to a bug, that we couldn’t fix in a general manner for color variants, we decided to remove <code>--MENU-SEARCH-BOX-ICONS-color</code> and introduced <code>--MENU-SEARCH-color</code> instead. You don’t need to change anything in your custom color stylesheet as the old name will be used as a fallback.</p>
<p><strong>Change</strong>: For consistency reasons, we renamed <code>--MENU-SEARCH-BOX-color</code> to <code>--MENU-SEARCH-BORDER-color</code>. You don’t need to change anything in your custom color stylesheet as the old name will be used as a fallback.</p>
</li>
<li>
<p><strong>New</strong>: With this release you are now capable to define your own <em>dark mode</em> variants.</p>
<p>To make this possible, we have introduced a lot more color variables you can use in <ahref="../../basics/customization/#theme-variant">your color variants</a>. Your old variants will still work and don’t need to be changed as appropriate fallback values are used by the theme. Nevertheless, the new colors allow for much more customization.</p>
<p><strong>New</strong>: To make the creation of new variants easier for you, we’ve added a new interactive <ahref="../../basics/generator/">theme variant generator</a>. This feature will not work with Internet Explorer 11.</p>
<p><strong>New</strong>: You can now configure multiple color variants in your <code>config.toml</code>. In this case, the first variant is the default chosen on first view and a variant switch will be shown in the menu footer. See the <ahref="../../basics/customization/#multiple-variants">documentation</a> for configuration.</p>
<p>Note, that the new variant switch will not work with Internet Explorer 11 as it does not support CSS variables. Therefore, the variant switcher will not be displayed with Internet Explorer 11.</p>
<p><strong>Breaking</strong>: This release removes the themes implementation of <code>ref</code>/<code>relref</code> in favor for Hugos standard implementation. This is because of inconsistencies with the themes implementation. In advantage, your project becomes standard compliant and exchanging this theme in your project to some other theme will be effortless.</p>
<p>In a standard compliant form you must not link to the <code>*.md</code> file but to its logical name. You’ll see, referencing other pages becomes much easier. All three types result in the same reference:</p>
<p>If you’ve linked from a page of one language to a page of another language, conversion is a bit more difficult but <ahref="https://gohugo.io/content-management/cross-references/#link-to-another-language-version">Hugo got you covered</a> as well.</p>
<p>Also, the old themes implementation allowed refs to non-existing content. This will cause Hugos implementation to show the error below and abort the generation. If your project relies on this old behavior, you can <ahref="https://gohugo.io/content-management/cross-references/#link-to-another-language-version">reconfigure the error handling</a> of Hugos implementation.</p>
<p>In the best case your usage of the old implementation is already standard compliant and you don’t need to change anything. You’ll notice this very easily once you’ve started <code>hugo server</code> after an upgrade and no errors are written to the console.</p>
<p>You may see errors on the console after the update in the form:</p>
<divclass="highlight"><pretabindex="0"class="chroma"><codeclass="language-sh"data-lang="sh"><spanclass="line"><spanclass="cl">ERROR 2021/11/19 22:29:10 <spanclass="o">[</span>en<spanclass="o">]</span> REF_NOT_FOUND: Ref <spanclass="s2">"basics/configuration/_index.md"</span>: <spanclass="s2">"hugo-theme-relearn\exampleSite\content\_index.en.md:19:22"</span>: page not found
</span></span></code></pre></div><p>In this case, you must apply one of two options:</p>
<ol>
<li>
<p>Copy the old implementation files <code>theme/hugo-theme-relearn/layouts/shortcode/ref.html</code> and <code>theme/hugo-theme-relearn/layouts/shortcode/relref.html</code> to your own projects <code>layouts/shortcode/ref.html</code> and <code>layouts/shortcode/relref.html</code> respectively. <strong>This is not recommended</strong> as your project will still rely on non-standard behavior afterwards.</p>
</li>
<li>
<p>Start up a text editor with regular expression support for search and replace. Apply the following conversions in the given order on all <code>*.md</code> files. <strong>This is the recommended choice</strong>.</p>
<p><strong>Change</strong>: Although never officially documented, this release removes the font <code>Novacento</code>/<code>Novecento</code>. If you use it in an overwritten CSS please replace it with <code>Work Sans</code>. This change was necessary as Novacento did not provide all Latin special characters and lead to mixed styled character text eg. for Czech.</p>
<p><strong>New</strong>: The theme now supports favicons served from <code>static/images/</code> named as <code>favicon</code> or <code>logo</code> in SVG, PNG or ICO format <ahref="../../basics/customization/#change-the-favicon">out of the box</a>. An overridden partial <code>layouts/partials/favicon.html</code> may not be necessary anymore in most cases.</p>
<p><strong>New</strong>: You can hide the table of contents menu for the whole site by setting the <code>disableToc</code> option in your <code>config.toml</code>. For an example see <ahref="../../basics/configuration/#global-site-parameters">the example configuration</a>.</p>
<li><strong>New</strong>: Optional second parameter for <ahref="../../shortcodes/notice/"><code>notice</code></a> shortcode to set title in box header.</li>
<li><strong>New</strong>: Your site can now be served from a subfolder if you set <code>baseURL</code> and <code>canonifyURLs=true</code> in your <code>config.toml</code>. See the <ahref="../../basics/configuration/#a-word-on-running-your-site-in-a-subfolder">documentation</a> for a detailed example.</li>
<li><strong>Change</strong>: New colors <code>--CODE-BLOCK-color</code> and <code>--CODE-BLOCK-BG-color</code> were added to provide a fallback for Hugos syntax highlighting in case <code>guessSyntax=true</code> is set. Ideally the colors are set to the same values as the ones from your chosen chroma style.</li>
<p><strong>Change</strong>: Creation of customized stylesheets was simplified down to only contain the CSS variables. Everything else can and should be deleted from your custom stylesheet to assure everything works fine. For the predefined stylesheet variants, this change is already included.</p>
</li>
<li>
<p><strong>New</strong>: Hidden pages are displayed by default in their according tags page. You can now turn off this behavior by setting <code>disableTagHiddenPages=true</code> in your <code>config.toml</code>.</p>
<p><strong>New</strong>: You can define the expansion state of your menus for the whole site by setting the <code>alwaysopen</code> option in your <code>config.toml</code>. Please see further <ahref="../../cont/pages/#override-expand-state-rules-for-menu-entries">documentation</a> for possible values and default behavior.</p>
<p><strong>New</strong>: New frontmatter <code>ordersectionsby</code> option to change immediate children sorting in menu and <code>children</code> shortcode. Possible values are <code>title</code> or <code>weight</code>.</p>
</li>
<li>
<p><strong>New</strong>: Alternate content of a page is now advertised in the HTML meta tags. See <ahref="https://gohugo.io/templates/rss/#reference-your-rss-feed-in-head">Hugo documentation</a>.</p>
<li><strong>New</strong>: Showcase multilanguage features by providing a documentation translation “fer us pirrrates”. There will be no other translations besides the original English one and the Pirates one due to maintenance constraints.</li>
<li><strong>New</strong>: Hidden pages are displayed by default in the sitemap generated by Hugo and are therefore visible for search engine indexing. You can now turn off this behavior by setting <code>disableSeoHiddenPages=true</code> in your <code>config.toml</code>.</li>
<p><strong>Change</strong>: In case the site’s structure contains additional *.md files not part of the site (eg files that are meant to be included by site pages - see <code>CHANGELOG.md</code> in the exampleSite), they will now be ignored by the search.</p>
<p><strong>New</strong>: Hidden pages are indexed for the site search by default. You can now turn off this behavior by setting <code>disableSearchHiddenPages=true</code> in your <code>config.toml</code>.</p>
</li>
<li>
<p><strong>New</strong>: If a search term is found in an <code>expand</code> shortcode, the expand will be opened.</p>
</li>
<li>
<p><strong>New</strong>: The menu will scroll the active item into view on load.</p>
<p><strong>Change</strong>: Syntax highlighting was switched to the <ahref="https://gohugo.io/content-management/syntax-highlighting/">built in Hugo mechanism</a>. You may need to configure a new stylesheet or decide to roll you own as described on in the Hugo documentation</p>
<p><strong>Change</strong>: In the predefined stylesheets there was a typo and <code>--MENU-HOME-LINK-HOVERED-color</code> must be changed to <code>--MENU-HOME-LINK-HOVER-color</code>. You don’t need to change anything in your custom color stylesheet as the old name will be used as a fallback.</p>
</li>
<li>
<p><strong>Change</strong>: <code>--MENU-HOME-LINK-color</code> and <code>--MENU-HOME-LINK-HOVER-color</code> were missing in the documentation. You should add them to your custom stylesheets if you want to override the defaults.</p>
</li>
<li>
<p><strong>Change</strong>: Arrow navigation and <code>children</code> shortcode were ignoring setting for <code>ordersectionsby</code>. This is now changed and may result in different sorting order of your sub pages.</p>
</li>
<li>
<p><strong>Change</strong>: If hidden pages are accessed directly by typing their URL, they will be exposed in the menu.</p>
</li>
<li>
<p><strong>Change</strong>: A page without a <code>title</code> will be treated as <code>hidden=true</code>.</p>
<p><strong>New</strong>: You can define the expansion state of your menus in the frontmatter. Please see further <ahref="../../cont/pages/#override-expand-state-rules-for-menu-entries">documentation</a> for possible values and default behavior.</p>
<p><strong>New</strong>: New partials for defining pre/post content for menu items and the content. See <ahref="../../basics/customization/">documentation</a> for further reading.</p>
<li><strong>New</strong>: <ahref="../../shortcodes/mermaid/#configuration"><code>Mermaid</code></a> config options can be set in <code>config.toml</code>.</li>
<li><strong>New</strong>: Initial fork of the <ahref="https://github.com/matcornic/hugo-theme-learn">Learn theme</a> based on Learn 2.5.0 on 2021-07-01. This introduces no new features besides a global rename to <code>Relearn</code> and a new logo. For the reasons behind forking the Learn theme, see <ahref="https://github.com/matcornic/hugo-theme-learn/issues/442#issuecomment-907863495">this comment</a> in the Learn issues.</li>