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" >
2024-04-21 21:20:20 +00:00
< meta name = "generator" content = "Hugo 0.125.2" >
2024-04-07 21:49:57 +00:00
< meta name = "generator" content = "Relearn 5.27.0+tip" >
2022-04-02 13:30:16 +00:00
< meta name = "description" content = "Documentation for Hugo Relearn Theme" >
2023-10-10 21:22:41 +00:00
< meta name = "author" content = "Sören Weber" >
2023-10-11 16:03:03 +00:00
< meta name = "twitter:card" content = "summary_large_image" >
2024-02-24 13:03:50 +00:00
< meta name = "twitter:image" content = "https://mcshelby.github.io/hugo-theme-relearn/images/hero.png" >
2023-10-11 16:03:03 +00:00
< meta name = "twitter:title" content = "Archetypes :: Hugo Relearn Theme" >
< meta name = "twitter:description" content = "Documentation for Hugo Relearn Theme" >
2024-04-07 13:13:19 +00:00
< meta property = "og:url" content = "https://mcshelby.github.io/hugo-theme-relearn/cont/archetypes/index.html" >
< meta property = "og:site_name" content = "Hugo Relearn Theme" >
2023-10-11 15:32:39 +00:00
< meta property = "og:title" content = "Archetypes :: Hugo Relearn Theme" >
2024-04-07 13:13:19 +00:00
< meta property = "og:description" content = "Using the command: hugo new [ relative new content path ] , you can start a content file with the date and title automatically set . While this is a welcome feature , active writers need more: archetypes . These are preconfigured skeleton pages with default frontmatter .
The Relearn theme defines some few archetypes of pages but you are free to define new ones to your liking. All can be used at any level of the documentation, the only difference being the layout of the content.">
< meta property = "og:locale" content = "en" >
2023-10-11 15:32:39 +00:00
< meta property = "og:type" content = "website" >
2024-02-24 13:03:50 +00:00
< meta property = "og:image" content = "https://mcshelby.github.io/hugo-theme-relearn/images/hero.png" >
2022-04-02 13:30:16 +00:00
< title > Archetypes :: Hugo Relearn Theme< / title >
2024-02-24 13:03:50 +00:00
< link href = "https://mcshelby.github.io/hugo-theme-relearn/cont/archetypes/index.html" rel = "alternate" hreflang = "x-default" >
< link href = "https://mcshelby.github.io/hugo-theme-relearn/cont/archetypes/index.html" rel = "alternate" hreflang = "en" >
< link href = "https://mcshelby.github.io/hugo-theme-relearn/pir/cont/archetypes/index.html" rel = "alternate" hreflang = "art-pir" >
< link href = "https://mcshelby.github.io/hugo-theme-relearn/cont/archetypes/index.html" rel = "canonical" type = "text/html" title = "Archetypes :: Hugo Relearn Theme" >
2024-02-24 12:50:21 +00:00
< link href = "/hugo-theme-relearn/cont/archetypes/index.xml" rel = "alternate" type = "application/rss+xml" title = "Archetypes :: Hugo Relearn Theme" >
2024-04-22 19:29:49 +00:00
< link href = "/hugo-theme-relearn/images/logo.svg?1713814181" 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 -->
2024-04-22 19:29:49 +00:00
< link href = "/hugo-theme-relearn/css/fontawesome-all.min.css?1713814182" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "/hugo-theme-relearn/css/fontawesome-all.min.css?1713814182" rel = "stylesheet" > < / noscript >
< link href = "/hugo-theme-relearn/css/nucleus.css?1713814182" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/auto-complete.css?1713814182" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "/hugo-theme-relearn/css/auto-complete.css?1713814182" rel = "stylesheet" > < / noscript >
< link href = "/hugo-theme-relearn/css/perfect-scrollbar.min.css?1713814182" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/fonts.css?1713814182" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "/hugo-theme-relearn/css/fonts.css?1713814182" rel = "stylesheet" > < / noscript >
< link href = "/hugo-theme-relearn/css/theme.css?1713814182" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/theme-relearn-auto.css?1713814182" rel = "stylesheet" id = "R-variant-style" >
< link href = "/hugo-theme-relearn/css/chroma-relearn-auto.css?1713814182" rel = "stylesheet" id = "R-variant-chroma-style" >
< link href = "/hugo-theme-relearn/css/variant.css?1713814182" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/print.css?1713814182" rel = "stylesheet" media = "print" >
< link href = "/hugo-theme-relearn/css/format-print.css?1713814182" rel = "stylesheet" >
< script src = "/hugo-theme-relearn/js/variant.js?1713814182" > < / script >
2024-03-16 13:44:28 +00:00
< script >
2023-11-16 22:53:34 +00:00
window.relearn = window.relearn || {};
2024-03-18 20:59:19 +00:00
window.relearn.relBasePath='..\/..';
window.relearn.relBaseUri='..\/..\/..';
window.relearn.absBaseUri='https:\/\/mcshelby.github.io\/hugo-theme-relearn';
2024-03-16 12:40:13 +00:00
window.index_js_url="/hugo-theme-relearn/index.search.js";
2023-11-16 22:53:34 +00:00
// variant stuff
2024-04-19 06:38:17 +00:00
window.variants & & variants.init( [ 'relearn-auto', 'relearn-light', 'relearn-dark', 'relearn-bright', 'zen-auto', 'zen-light', 'zen-dark', 'retro-auto', 'neon', 'learn', 'blue', 'green', 'red' ] );
2023-11-16 22:53:34 +00:00
// 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}"`;
2022-04-02 13:30:16 +00:00
< / script >
2022-12-02 15:05:54 +00:00
< style >
2023-09-23 08:19:35 +00:00
#R-body img.bg-white {
2022-12-02 15:05:54 +00:00
background-color: white;
}
< / style >
2022-04-02 13:30:16 +00:00
< / head >
2024-02-24 12:50:21 +00:00
< body class = "mobile-support print disableInlineCopyToClipboard" data-url = "/hugo-theme-relearn/cont/archetypes/index.html" >
2023-09-23 08:19:35 +00:00
< div id = "R-body" class = "default-animation" >
< div id = "R-body-overlay" > < / div >
< nav id = "R-topbar" >
2023-09-18 18:49:44 +00:00
< div class = "topbar-wrapper" >
2023-09-13 21:30:04 +00:00
< div class = "topbar-sidebar-divider" > < / div >
2023-09-18 18:49:44 +00:00
< div class = "topbar-area topbar-area-start" data-area = "start" >
2023-12-05 07:41:41 +00:00
< 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 >
2023-09-12 21:10:21 +00:00
< / div >
2023-09-13 21:30:04 +00:00
< / div >
2023-09-20 22:28:27 +00:00
< ol class = "topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype = "http://schema.org/BreadcrumbList" > < li
2024-02-24 12:50:21 +00:00
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">< a itemprop = "item" href = "/hugo-theme-relearn/cont/index.html" > < span itemprop = "name" > Content< / span > < / a > < meta itemprop = "position" content = "1" > > < / li > < li
2023-09-23 22:28:49 +00:00
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement">< span itemprop = "name" > Archetypes< / span > < meta itemprop = "position" content = "2" > < / li >
2023-09-13 21:30:04 +00:00
< / ol >
2023-09-18 18:49:44 +00:00
< div class = "topbar-area topbar-area-end" data-area = "end" >
2024-04-07 19:58:38 +00:00
< div class = "topbar-button topbar-button-prev" data-content-empty = "disable" data-width-s = "show" data-width-m = "show" data-width-l = "show" > < a class = "topbar-control" href = "/hugo-theme-relearn/cont/frontmatter/index.html" title = "Frontmatter (🡐)" > < i class = "fa-fw fas fa-chevron-left" > < / i > < / a >
< / div >
< div class = "topbar-button topbar-button-next" data-content-empty = "disable" data-width-s = "show" data-width-m = "show" data-width-l = "show" > < a class = "topbar-control" href = "/hugo-theme-relearn/cont/markdown/index.html" title = "Markdown Syntax (🡒)" > < i class = "fa-fw fas fa-chevron-right" > < / i > < / a >
< / div >
2023-09-12 21:19:47 +00:00
< / div >
2022-04-02 13:30:16 +00:00
< / div >
< / nav >
2023-09-23 08:19:35 +00:00
< div id = "R-main-overlay" > < / div >
< main id = "R-body-inner" class = "highlightable default" tabindex = "-1" >
2022-04-02 13:30:16 +00:00
< div class = "flex-block-wrapper" >
2022-11-07 19:58:08 +00:00
< article class = "default" >
2023-05-19 18:46:07 +00:00
< header class = "headline" >
< / header >
2024-04-07 19:58:38 +00:00
2022-11-13 21:34:47 +00:00
< h1 id = "archetypes" > Archetypes< / h1 >
2022-07-05 22:16:52 +00:00
2024-04-21 21:48:09 +00:00
< p > Using the command: < code > hugo new [relative new content path]< / code > , you can start a content file with the date and title automatically set. While this is a welcome feature, active writers need more: < a href = "https://gohugo.io/content/archetypes/" rel = "external" target = "_self" > archetypes< / a > . These are preconfigured skeleton pages with default frontmatter.< / p >
2022-07-05 22:16:52 +00:00
< p > The Relearn theme defines some few archetypes of pages but you are free to define new ones to your liking. All can be used at any level of the documentation, the only difference being the layout of the content.< / p >
< h2 id = "predefined-archetypes" > Predefined Archetypes< / h2 >
< h3 id = "archetypes-home" > Home< / h3 >
< p > A < strong > Home< / strong > page is the starting page of your project. It’ s best to have only one page of this kind in your project.< / p >
2024-04-22 19:29:49 +00:00
< p > < a href = "#R-image-3ef1d8107c8a52a87b8b682e433771bc" class = "lightbox-link" > < img alt = "Home page" class = "bg-white border lazy lightbox noshadow figure-image" loading = "lazy" src = "/hugo-theme-relearn/cont/archetypes/pages-home.png?width=60pc" style = " height: auto; width: 60pc;" > < / a >
< a href = "javascript:history.back();" class = "lightbox-back" id = "R-image-3ef1d8107c8a52a87b8b682e433771bc" > < img alt = "Home page" class = "bg-white border lazy lightbox noshadow lightbox-image" loading = "lazy" src = "/hugo-theme-relearn/cont/archetypes/pages-home.png?width=60pc" > < / a > < / p >
2022-07-05 22:16:52 +00:00
< p > To create a home page, run the following command< / p >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-shell" data-lang = "shell" > < span class = "line" > < span class = "cl" > hugo new --kind home _index.md< / span > < / span > < / code > < / pre > < / div > < p > This leads to a file with the following content< / p >
2024-03-02 10:05:50 +00:00
2024-04-22 19:29:49 +00:00
< div class = "tab-panel" data-tab-group = "b0404cd96c6732d832c51fe310c6a44d" >
2024-03-02 10:05:50 +00:00
< div class = "tab-nav" >
< div class = "tab-nav-title" > ​ < / div >
< button
data-tab-item="_indexmd"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
2024-04-22 19:29:49 +00:00
onclick="switchTab('b0404cd96c6732d832c51fe310c6a44d','_indexmd')"
2024-03-02 10:05:50 +00:00
>
< span class = "tab-nav-text" > _index.md< / span >
< / button >
< / div >
< div class = "tab-content-container" >
< div
data-tab-item="_indexmd"
class="tab-content tab-panel-style cstyle initial active">
< div class = "tab-content-text" >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-toml" data-lang = "toml" > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > archetype< / span > < span class = "p" > =< / span > < span class = "s2" > " home" < / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > title< / span > < span class = "p" > =< / span > < span class = "s2" > " {{ replace .Name " < / span > < span class = "nx" > -< / span > < span class = "s2" > " " < / span > < span class = "s2" > " | title }}" < / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span >
2022-04-02 13:30:16 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > Lorem< / span > < span class = "nx" > Ipsum< / span > < span class = "p" > .< / span > < / span > < / span > < / code > < / pre > < / div > < / div >
< / div >
< / div >
< / div > < h3 id = "archetypes-chapter" > Chapter< / h3 >
2022-07-05 22:16:52 +00:00
< p > A < strong > Chapter< / strong > displays a page meant to be used as introduction for a set of child pages. Commonly, it contains a simple title and a catch line to define content that can be found below it.< / p >
2024-04-22 19:29:49 +00:00
< p > < a href = "#R-image-5cb8078cfb3e8b769b2ed3f754ee2faf" class = "lightbox-link" > < img alt = "Chapter page" class = "bg-white border lazy lightbox noshadow figure-image" loading = "lazy" src = "/hugo-theme-relearn/cont/archetypes/pages-chapter.png?width=60pc" style = " height: auto; width: 60pc;" > < / a >
< a href = "javascript:history.back();" class = "lightbox-back" id = "R-image-5cb8078cfb3e8b769b2ed3f754ee2faf" > < img alt = "Chapter page" class = "bg-white border lazy lightbox noshadow lightbox-image" loading = "lazy" src = "/hugo-theme-relearn/cont/archetypes/pages-chapter.png?width=60pc" > < / a > < / p >
2022-07-05 22:16:52 +00:00
< p > To create a chapter page, run the following command< / p >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-shell" data-lang = "shell" > < span class = "line" > < span class = "cl" > hugo new --kind chapter < name> /_index.md< / span > < / span > < / code > < / pre > < / div > < p > This leads to a file with the following content< / p >
2024-03-02 10:05:50 +00:00
2024-04-22 19:29:49 +00:00
< div class = "tab-panel" data-tab-group = "fb68aeb19d3f45acfe4398a190f6624e" >
2024-03-02 10:05:50 +00:00
< div class = "tab-nav" >
< div class = "tab-nav-title" > ​ < / div >
< button
data-tab-item="_indexmd"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
2024-04-22 19:29:49 +00:00
onclick="switchTab('fb68aeb19d3f45acfe4398a190f6624e','_indexmd')"
2024-03-02 10:05:50 +00:00
>
< span class = "tab-nav-text" > _index.md< / span >
< / button >
< / div >
< div class = "tab-content-container" >
< div
data-tab-item="_indexmd"
class="tab-content tab-panel-style cstyle initial active">
< div class = "tab-content-text" >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-toml" data-lang = "toml" > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > archetype< / span > < span class = "p" > =< / span > < span class = "s2" > " chapter" < / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > title< / span > < span class = "p" > =< / span > < span class = "s2" > " {{ replace .Name " < / span > < span class = "nx" > -< / span > < span class = "s2" > " " < / span > < span class = "s2" > " | title }}" < / span >
2024-03-15 20:10:54 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > weight< / span > < span class = "p" > =< / span > < span class = "mi" > 1< / span >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span >
2022-04-02 13:30:16 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > Lorem< / span > < span class = "nx" > Ipsum< / span > < span class = "p" > .< / span > < / span > < / span > < / code > < / pre > < / div > < / div >
< / div >
< / div >
2024-03-15 20:10:54 +00:00
< / div > < p > The < code > weight< / code > number will be used to generate the subtitle of the chapter page, set the number to a consecutive value starting at 1 for each new chapter level.< / p >
2022-07-05 22:16:52 +00:00
< h3 id = "archetypes-default" > Default< / h3 >
< p > A < strong > Default< / strong > page is any other content page. If you set an unknown archetype in your frontmatter, this archetype will be used to generate the page.< / p >
2024-04-22 19:29:49 +00:00
< p > < a href = "#R-image-b95a42b15c856510884d5962fb4579e9" class = "lightbox-link" > < img alt = "Default page" class = "bg-white border lazy lightbox noshadow figure-image" loading = "lazy" src = "/hugo-theme-relearn/cont/archetypes/pages-default.png?width=60pc" style = " height: auto; width: 60pc;" > < / a >
< a href = "javascript:history.back();" class = "lightbox-back" id = "R-image-b95a42b15c856510884d5962fb4579e9" > < img alt = "Default page" class = "bg-white border lazy lightbox noshadow lightbox-image" loading = "lazy" src = "/hugo-theme-relearn/cont/archetypes/pages-default.png?width=60pc" > < / a > < / p >
2022-07-05 22:16:52 +00:00
< p > To create a default page, run either one of the following commands< / p >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-shell" data-lang = "shell" > < span class = "line" > < span class = "cl" > hugo new < chapter> /< name> /_index.md< / span > < / span > < / code > < / pre > < / div > < p > or< / p >
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-shell" data-lang = "shell" > < span class = "line" > < span class = "cl" > hugo new < chapter> /< name> .md< / span > < / span > < / code > < / pre > < / div > < p > This leads to a file with the following content< / p >
2024-03-02 10:05:50 +00:00
2024-04-22 19:29:49 +00:00
< div class = "tab-panel" data-tab-group = "8d1b821a590ea43a7171d9e3915c9f46" >
2024-03-02 10:05:50 +00:00
< div class = "tab-nav" >
< div class = "tab-nav-title" > ​ < / div >
< button
data-tab-item="md"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
2024-04-22 19:29:49 +00:00
onclick="switchTab('8d1b821a590ea43a7171d9e3915c9f46','md')"
2024-03-02 10:05:50 +00:00
>
< span class = "tab-nav-text" > *.md< / span >
< / button >
< / div >
< div class = "tab-content-container" >
< div
data-tab-item="md"
class="tab-content tab-panel-style cstyle initial active">
< div class = "tab-content-text" >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-toml" data-lang = "toml" > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > title< / span > < span class = "p" > =< / span > < span class = "s2" > " {{ replace .Name " < / span > < span class = "nx" > -< / span > < span class = "s2" > " " < / span > < span class = "s2" > " | title }}" < / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span >
2022-04-02 13:30:16 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > Lorem< / span > < span class = "nx" > Ipsum< / span > < span class = "p" > .< / span > < / span > < / span > < / code > < / pre > < / div > < / div >
< / div >
< / div >
2024-03-15 20:10:54 +00:00
< / div > < h2 id = "self-defined-archetypes" > Self defined Archetypes< / h2 >
2022-07-05 22:16:52 +00:00
< p > If you are in need of further archetypes you can define your own or even redefine existing ones.< / p >
< h3 id = "template" > Template< / h3 >
< p > Define a template file in your project at < code > archetypes/< kind> .md< / code > and make sure it has at least the frontmatter parameter for that archetype like< / p >
2024-03-02 10:05:50 +00:00
2024-04-22 19:29:49 +00:00
< div class = "tab-panel" data-tab-group = "33ffbf04f6d2897163ee12dc0bdfc4e5" >
2024-03-02 10:05:50 +00:00
< div class = "tab-nav" >
< div class = "tab-nav-title" > ​ < / div >
< button
data-tab-item="ltkindgtmd"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
2024-04-22 19:29:49 +00:00
onclick="switchTab('33ffbf04f6d2897163ee12dc0bdfc4e5','ltkindgtmd')"
2024-03-02 10:05:50 +00:00
>
< span class = "tab-nav-text" > < kind> .md< / span >
< / button >
< / div >
< div class = "tab-content-container" >
< div
data-tab-item="ltkindgtmd"
class="tab-content tab-panel-style cstyle initial active">
< div class = "tab-content-text" >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-toml" data-lang = "toml" > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span >
2024-03-02 10:05:50 +00:00
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "nx" > archetype< / span > < span class = "p" > =< / span > < span class = "s2" > " < kind> " < / span >
< / span > < / span > < span class = "line" > < span class = "cl" > < span class = "err" > +++< / span > < / span > < / span > < / code > < / pre > < / div > < / div >
< / div >
< / div >
< / div > < p > Afterwards you can generate new content files of that kind with the following command< / p >
2024-03-11 20:44:09 +00:00
< div class = "highlight wrap-code" > < pre tabindex = "0" class = "chroma" > < code class = "language-shell" data-lang = "shell" > < span class = "line" > < span class = "cl" > hugo new --kind < kind> < name> /_index.md< / span > < / span > < / code > < / pre > < / div > < h3 id = "partials" > Partials< / h3 >
2022-07-05 22:16:52 +00:00
< p > To define how your archetypes are rendered, define corresponding partial files in your projects directory < code > layouts/partials/archetypes/< kind> < / code > .< / p >
< p > If you use an unknown archetype in your frontmatter, the < code > default< / code > archetype will be used to generate the page.< / p >
2022-07-14 20:20:11 +00:00
< p > Related to each archetype, several < em > hook< / em > partial files in the form of < code > < hook> .html< / code > can be given inside each archetype directory. If a partial for a specific hook is missing, no output is generated for this hook.< / p >
2022-07-05 22:16:52 +00:00
< p > The following hooks are used:< / p >
< table >
< thead >
< tr >
2023-07-27 15:06:14 +00:00
< th > Name< / th >
< th > Notes< / th >
2022-07-05 22:16:52 +00:00
< / tr >
< / thead >
< tbody >
< tr >
2023-07-27 15:06:14 +00:00
< td > styleclass< / td >
< td > Defines a set of CSS classes to be added to the HTML’ s < code > < main> < / code > element. You can use these classes to define own CSS rules in your < code > custom-header.html< / code > < / td >
2022-07-05 22:16:52 +00:00
< / tr >
< tr >
2023-07-27 15:06:14 +00:00
< td > article< / td >
< td > Defines the HTML how to render your content< / td >
2022-07-05 22:16:52 +00:00
< / tr >
< / tbody >
< / table >
< p > Take a look at the existing archetypes of this theme to get an idea how to utilize it.< / p >
2022-07-14 20:20:11 +00:00
< h4 id = "output-formats" > Output formats< / h4 >
2024-04-21 21:48:09 +00:00
< p > Each hook file can be overridden of a specific < a href = "https://gohugo.io/templates/output-formats/" rel = "external" target = "_self" > output format< / a > . Eg. if you define a new output format < code > PLAINTEXT< / code > in your < code > hugo.toml< / code > , you can add a file < code > layouts/partials/archetypes/default.plaintext.html< / code > to change the way how normal content is written for that output format.< / p >
2022-07-05 22:16:52 +00:00
2022-04-02 13:30:16 +00:00
< footer class = "footline" >
< / footer >
< / article >
2023-05-17 22:13:41 +00:00
2022-04-02 13:30:16 +00:00
< / div >
< / main >
< / div >
2024-04-22 19:29:49 +00:00
< script src = "/hugo-theme-relearn/js/clipboard.min.js?1713814182" defer > < / script >
< script src = "/hugo-theme-relearn/js/perfect-scrollbar.min.js?1713814182" defer > < / script >
< script src = "/hugo-theme-relearn/js/theme.js?1713814182" defer > < / script >
2022-04-02 13:30:16 +00:00
< / body >
< / html >