2022-04-02 13:30:16 +00:00
<!DOCTYPE html>
2024-04-27 13:29:53 +00:00
< html lang = "en" dir = "ltr" itemscope itemtype = "http://schema.org/Article" >
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-08-26 21:09:09 +00:00
< meta name = "generator" content = "Hugo 0.133.1" >
2024-08-26 21:17:03 +00:00
< meta name = "generator" content = "Relearn 6.2.0+tip" >
2024-04-24 19:38:41 +00:00
< meta name = "description" content = "Using the command: hugo new [relative new content path], you can start a content file with the date and title automatically set." >
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" >
2024-04-24 19:38:41 +00:00
< meta name = "twitter:description" content = "Using the command: hugo new [relative new content path], you can start a content file with the date and title automatically set." >
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-24 19:38:41 +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." >
2024-04-07 13:13:19 +00:00
< 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" >
2024-04-24 19:38:41 +00:00
< meta itemprop = "name" content = "Archetypes :: Hugo Relearn Theme" >
< meta itemprop = "description" content = "Using the command: hugo new [relative new content path], you can start a content file with the date and title automatically set." >
< meta itemprop = "wordCount" content = "577" >
< meta itemprop = "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" >
2024-04-30 20:08:46 +00:00
< link href = "https://mcshelby.github.io/hugo-theme-relearn/pir/cont/archetypes/index.html" rel = "alternate" hreflang = "art-x-pir" >
2024-02-24 13:03:50 +00:00
< 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-08-27 13:37:45 +00:00
< link href = "/hugo-theme-relearn/images/logo.svg?1724765856" rel = "icon" type = "image/svg+xml" >
< link href = "/hugo-theme-relearn/css/fontawesome-all.min.css?1724765856" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "/hugo-theme-relearn/css/fontawesome-all.min.css?1724765856" rel = "stylesheet" > < / noscript >
< link href = "/hugo-theme-relearn/css/nucleus.css?1724765856" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/auto-complete.css?1724765856" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "/hugo-theme-relearn/css/auto-complete.css?1724765856" rel = "stylesheet" > < / noscript >
< link href = "/hugo-theme-relearn/css/perfect-scrollbar.min.css?1724765856" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/fonts.css?1724765856" rel = "stylesheet" media = "print" onload = "this.media='all';this.onload=null;" > < noscript > < link href = "/hugo-theme-relearn/css/fonts.css?1724765856" rel = "stylesheet" > < / noscript >
< link href = "/hugo-theme-relearn/css/theme.css?1724765856" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/theme-relearn-auto.css?1724765856" rel = "stylesheet" id = "R-variant-style" >
< link href = "/hugo-theme-relearn/css/chroma-relearn-auto.css?1724765856" rel = "stylesheet" id = "R-variant-chroma-style" >
< link href = "/hugo-theme-relearn/css/variant.css?1724765856" rel = "stylesheet" >
< link href = "/hugo-theme-relearn/css/print.css?1724765856" rel = "stylesheet" media = "print" >
< link href = "/hugo-theme-relearn/css/format-print.css?1724765856" rel = "stylesheet" >
< script src = "/hugo-theme-relearn/js/variant.js?1724765856" > < / 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-08-22 16:34:04 +00:00
window.relearn.disableAnchorCopy=false;
window.relearn.disableAnchorScrolling=false;
2024-08-27 13:37:45 +00:00
window.index_js_url="/hugo-theme-relearn/index.search.js?1724765856";
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-08-27 13:37:45 +00:00
< p > < a href = "#R-image-835b9dbb36bbaafca5395b680faeda60" 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-835b9dbb36bbaafca5395b680faeda60" > < 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-08-27 13:37:45 +00:00
< div class = "tab-panel" data-tab-group = "153e686faddb3b3e8a0fbcf68ea2ab8b" >
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-08-27 13:37:45 +00:00
onclick="switchTab('153e686faddb3b3e8a0fbcf68ea2ab8b','_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-08-27 13:37:45 +00:00
< p > < a href = "#R-image-b9a084be3d91c2bc0c78da321e2f760f" 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-b9a084be3d91c2bc0c78da321e2f760f" > < 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-08-27 13:37:45 +00:00
< div class = "tab-panel" data-tab-group = "331aeed74f23555c8c8eda938f0c1dba" >
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-08-27 13:37:45 +00:00
onclick="switchTab('331aeed74f23555c8c8eda938f0c1dba','_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-08-27 13:37:45 +00:00
< p > < a href = "#R-image-9f8b5ec0df34068ef0ba5e46a0a67e0d" 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-9f8b5ec0df34068ef0ba5e46a0a67e0d" > < 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-08-27 13:37:45 +00:00
< div class = "tab-panel" data-tab-group = "afccfc634eee5f9c69030ea65500c568" >
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-08-27 13:37:45 +00:00
onclick="switchTab('afccfc634eee5f9c69030ea65500c568','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-08-27 13:37:45 +00:00
< div class = "tab-panel" data-tab-group = "1a0bb9d4d1139ef3900da79aaf923630" >
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-08-27 13:37:45 +00:00
onclick="switchTab('1a0bb9d4d1139ef3900da79aaf923630','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-08-27 13:37:45 +00:00
< script src = "/hugo-theme-relearn/js/clipboard.min.js?1724765856" defer > < / script >
< script src = "/hugo-theme-relearn/js/perfect-scrollbar.min.js?1724765856" defer > < / script >
< script src = "/hugo-theme-relearn/js/theme.js?1724765856" defer > < / script >
2022-04-02 13:30:16 +00:00
< / body >
< / html >