diff --git a/archetypes/chapter.md b/archetypes/chapter.md index 9df5bf9973..f9526d715c 100644 --- a/archetypes/chapter.md +++ b/archetypes/chapter.md @@ -1,12 +1,8 @@ +++ -chapter = true -menuPre = "X. " +archetype = "chapter" +narrow = true title = "{{ replace .Name "-" " " | title }}" -weight = 5 +weight = X +++ -### Chapter X - -# Some Chapter title - Lorem Ipsum. \ No newline at end of file diff --git a/archetypes/default.md b/archetypes/default.md index 0af9e2105c..8666ead320 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,6 +1,6 @@ +++ title = "{{ replace .Name "-" " " | title }}" -weight = 5 +weight = X +++ Lorem Ipsum. \ No newline at end of file diff --git a/archetypes/home.md b/archetypes/home.md new file mode 100644 index 0000000000..065f0d5dd7 --- /dev/null +++ b/archetypes/home.md @@ -0,0 +1,6 @@ ++++ +archetype = "home" +title = "{{ replace .Name "-" " " | title }}" +++ + +Lorem Ipsum. \ No newline at end of file diff --git a/exampleSite/content/_index.en.md b/exampleSite/content/_index.en.md index 2eb94e4104..5ecd596143 100644 --- a/exampleSite/content/_index.en.md +++ b/exampleSite/content/_index.en.md @@ -1,9 +1,8 @@ +++ +archetype = "home" title = "Hugo Relearn Theme" +++ -# Hugo Relearn Theme - The [Relearn theme](http://github.com/McShelby/hugo-theme-relearn) is a theme for [Hugo](https://gohugo.io/), a static website generator written in Go. Where Hugo is often used for blogs, this theme is designed with documentation in mind. {{% notice info %}} diff --git a/exampleSite/content/_index.pir.md b/exampleSite/content/_index.pir.md index daad3e0826..4881ae4880 100644 --- a/exampleSite/content/_index.pir.md +++ b/exampleSite/content/_index.pir.md @@ -1,4 +1,5 @@ +++ +archetype = "home" title = "Cap'n Hugo Relearrrn Theme" +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/basics/_index.en.md b/exampleSite/content/basics/_index.en.md index 4d67f9be71..e5b064c981 100755 --- a/exampleSite/content/basics/_index.en.md +++ b/exampleSite/content/basics/_index.en.md @@ -1,11 +1,8 @@ +++ -chapter = true +archetype = "chapter" +narrow = true title = "Basics" weight = 1 +++ -### Chapter 1 - -# Basics - Discover what this Hugo theme is all about and the core-concepts behind it. diff --git a/exampleSite/content/basics/_index.pir.md b/exampleSite/content/basics/_index.pir.md index 3ffb2d4578..b7d8e5a691 100644 --- a/exampleSite/content/basics/_index.pir.md +++ b/exampleSite/content/basics/_index.pir.md @@ -1,5 +1,6 @@ +++ -chapter = true +archetype = "chapter" +narrow = true title = "Basics" weight = 1 +++ diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index 3deadfe1ea..2b848abe2d 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -14,9 +14,16 @@ This document shows you what's new in the latest release. For a detailed list of --- -## 4.3.0 +## 5.0.0 -- **Change**: Renaming the frontmatter options `pre` / `post` to `menuPre` / `menuPost`. 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. +- **Change**: The way [archetypes]({{% relref "cont/archetypes" %}}) are used to generate output has changed. Your existing content 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 files to the new way. + + - for your home page, add the frontmatter parameter `archetype = "home"` + - for all files having the old frontmatter parameter `chapter = true`, replace that parameter with `archetype = "chapter"` + +- **Change**: The frontmatter options `pre` / `post` were renamed to `menuPre` / `menuPost`. 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. - **New**: Adding new partials `heading-pre.html` / `heading-post.html` and according frontmatter options `headingPre` / `headingPost` to modifiy the way your page`s main heading gets styled. diff --git a/exampleSite/content/cont/_index.en.md b/exampleSite/content/cont/_index.en.md index c0152a656e..b1af945088 100755 --- a/exampleSite/content/cont/_index.en.md +++ b/exampleSite/content/cont/_index.en.md @@ -1,11 +1,8 @@ +++ -chapter = true +archetype = "chapter" +narrow = true title = "Content" weight = 2 +++ -### Chapter 2 - -# Content - Find out how to create and organize your content quickly and intuitively. diff --git a/exampleSite/content/cont/_index.pir.md b/exampleSite/content/cont/_index.pir.md index 4a040d652f..ad488aae31 100644 --- a/exampleSite/content/cont/_index.pir.md +++ b/exampleSite/content/cont/_index.pir.md @@ -1,5 +1,6 @@ +++ -chapter = true +archetype = "chapter" +narrow = true title = "Rambl'n" weight = 2 +++ diff --git a/exampleSite/content/cont/archetypes.en.md b/exampleSite/content/cont/archetypes.en.md deleted file mode 100644 index 4c29ff3123..0000000000 --- a/exampleSite/content/cont/archetypes.en.md +++ /dev/null @@ -1,58 +0,0 @@ -+++ -title = "Archetypes" -weight = 10 -+++ - -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](https://gohugo.io/content/archetypes/). - -It is pre-configured skeleton pages with default front matter. Please refer to the documentation for types of page to understand the differences. - -## Chapter {#archetypes-chapter} - -To create a Chapter page, run the following commands - -```shell -hugo new --kind chapter /_index.md -``` - -It will create a page with predefined Front-Matter: - -```toml -+++ -chapter = true -menuPre = "X. " -title = "{{ replace .Name "-" " " | title }}" -weight = 5 -+++ - -### Chapter X - -# Some Chapter title - -Lorem Ipsum. -``` - -## Default - -To create a default page, run either one of the following commands either - -```shell -hugo new //_index.md -``` - -or - -```shell -hugo new /.md -``` - -It will create a page with predefined Front-Matter: - -```toml -+++ -title = "{{ replace .Name "-" " " | title }}" -weight = 5 -+++ - -Lorem Ipsum. -``` diff --git a/exampleSite/content/cont/archetypes/_index.en.md b/exampleSite/content/cont/archetypes/_index.en.md new file mode 100644 index 0000000000..4d2e39d07a --- /dev/null +++ b/exampleSite/content/cont/archetypes/_index.en.md @@ -0,0 +1,119 @@ ++++ +title = "Archetypes" +weight = 10 ++++ + +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](https://gohugo.io/content/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. + +## Predefined Archetypes + +### Home {#archetypes-home} + +A **Home** page is the starting page of your project. It's best to have only one page of this kind in your project. + +![Home page](images/pages-home.png?classes=shadow&width=60pc) + +To create a home page, run the following command + +```shell +hugo new --kind home _index.md +``` + +This leads to a file with the following content + +```markdown ++++ +archetype = "home" +title = "{{ replace .Name "-" " " | title }}" ++++ + +Lorem Ipsum. +``` + +### Chapter {#archetypes-chapter} + +A **Chapter** 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. + +![Chapter page](images/pages-chapter.png?classes=shadow&width=60pc) + +To create a chapter page, run the following command + +```shell +hugo new --kind chapter /_index.md +``` + +This leads to a file with the following content + +```markdown ++++ +archetype = "chapter" +narrow = true +title = "{{ replace .Name "-" " " | title }}" +weight = X ++++ + +Lorem Ipsum. +``` + +Replace the `X` with a number. Because this number will be used to generate the subtitle of the content page, set the number to a consecutive value starting at 1 for each new chapter level. + +### Default {#archetypes-default} + +A **Default** page is any other content page. If you set an unknown archetype in your frontmatter, this archetype will be used to generate the page. + +![Default page](images/pages-default.png?classes=shadow&width=60pc) + +To create a default page, run either one of the following commands + +```shell +hugo new //_index.md +``` + +or + +```shell +hugo new /.md +``` + +This leads to a file with the following content + +```markdown ++++ +title = "{{ replace .Name "-" " " | title }}" +weight = X ++++ + +Lorem Ipsum. +``` + +Replace the `X` with a number or delete the whole `weight` parameter entirly. + +## Selfdefined Archetypes + +If you are in need of further archetypes you can define your own or even redefine existing ones. + +### Template + +Define a template file in your project at `archetypes/.md` and make sure it has at least the frontmatter parameter for that archetype like + +````markdown ++++ +archetype = "" ++++ +```` + +Afterwards you can generate new content files of that kind with the follwing command + +```shell +hugo new --kind /_index.md +``` + +### Partial + +To define how your archetypes are rendered, define a corresponding file in your project at `layouts/partials/archetypes/.html`. + +Take a look at the existing archetypes of this theme to get an idea how to utilize it. + +If you use an unknown archetype in your frontmatter, the `default` archetype will be used to generate the page. diff --git a/exampleSite/content/cont/archetypes.pir.md b/exampleSite/content/cont/archetypes/_index.pir.md similarity index 100% rename from exampleSite/content/cont/archetypes.pir.md rename to exampleSite/content/cont/archetypes/_index.pir.md diff --git a/exampleSite/content/cont/pages/images/pages-chapter.png b/exampleSite/content/cont/archetypes/images/pages-chapter.png similarity index 100% rename from exampleSite/content/cont/pages/images/pages-chapter.png rename to exampleSite/content/cont/archetypes/images/pages-chapter.png diff --git a/exampleSite/content/cont/pages/images/pages-default.png b/exampleSite/content/cont/archetypes/images/pages-default.png similarity index 100% rename from exampleSite/content/cont/pages/images/pages-default.png rename to exampleSite/content/cont/archetypes/images/pages-default.png diff --git a/exampleSite/content/cont/archetypes/images/pages-home.png b/exampleSite/content/cont/archetypes/images/pages-home.png new file mode 100644 index 0000000000..8f7df2474b Binary files /dev/null and b/exampleSite/content/cont/archetypes/images/pages-home.png differ diff --git a/exampleSite/content/cont/i18n/_index.en.md b/exampleSite/content/cont/i18n/_index.en.md index 14e1acd603..086f4e74e8 100644 --- a/exampleSite/content/cont/i18n/_index.en.md +++ b/exampleSite/content/cont/i18n/_index.en.md @@ -49,7 +49,7 @@ Be aware that only translated pages are displayed in menu. It's not replaced wit {{% /notice %}} {{% notice tip %}} -Use [slug](https://gohugo.io/content-management/multilingual/#translate-your-content) Front Matter parameter to translate urls too. +Use [slug](https://gohugo.io/content-management/multilingual/#translate-your-content) frontmatter parameter to translate urls too. {{% /notice %}} ## Search diff --git a/exampleSite/content/cont/pages/_index.en.md b/exampleSite/content/cont/pages/_index.en.md index d62f62fcdd..7447282683 100644 --- a/exampleSite/content/cont/pages/_index.en.md +++ b/exampleSite/content/cont/pages/_index.en.md @@ -39,52 +39,10 @@ content `_index.md` is required in each folder, it’s your “folder home page” {{% /notice %}} -## Types - -The Relearn theme defines two types of pages. *Default* and *Chapter*. Both can be used at any level of the documentation, the only difference being layout display. - -### Chapter {#chapter-style} - -A **Chapter** 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 under it. - -You can define any HTML as prefix for the menu. In the example below, it's just a number but that could be an [icon](https://fortawesome.github.io/Font-Awesome/). - -![Chapter page](images/pages-chapter.png?classes=shadow&width=60pc) - -```markdown -+++ -chapter = true -menuPre = "1. " -title = "Basics" -weight = 5 -+++ - -### Chapter 1 - -# Basics - -Discover what this Hugo theme is all about and the core-concepts behind it. -``` - -To tell the Relearn theme to consider a page as a chapter, set `chapter=true` in the Front Matter of the page. - -### Default - -A **Default** page is any other content page. - -![Default page](images/pages-default.png?classes=shadow&width=60pc) - -```toml -+++ -title = "Installation" -weight = 15 -+++ -``` - -The following steps are here to help you initialize your new website. If you don't know Hugo at all, we strongly suggest you to train by following this [great documentation for beginners](https://gohugo.io/overview/quickstart/). - ## Create your project +The following steps are here to help you initialize your new website. If you don't know Hugo at all, we strongly suggest you to train by following [great documentation for beginners](https://gohugo.io/overview/quickstart/). + Hugo provides a `new` command to create a new website. ```shell @@ -93,11 +51,11 @@ hugo new site The Relearn theme provides [archetypes]({{%relref "cont/archetypes" %}}) to help you create this kind of pages. -## Front Matter configuration +## Frontmatter Configuration -Each Hugo page has to define a [Front Matter](https://gohugo.io/content/front-matter/) in *toml*, *yaml* or *json*. This site will use *toml* in all cases. +Each Hugo page has to define a [frontmatter](https://gohugo.io/content/front-matter/) in *toml*, *yaml* or *json*. This site will use *toml* in all cases. -The Relearn theme uses the following parameters on top of Hugo ones : +The Relearn theme uses the following parameters on top of Hugo ones: ```toml +++ @@ -118,8 +76,8 @@ headingPost = "" menuPre = "" # The title of the page in menu will be postfixed by this HTML content menuPost = "" -# Set the page as a chapter, changing the way it's displayed -chapter = false +# Makes the content more narrow, increases font-size and alignment +narrow = false # Hide a menu entry by setting this to true hidden = false # Display name of this page modifier. If set, it will be displayed in the footer. @@ -185,11 +143,3 @@ The theme generates the menu based on the following rules: - all remaining entries are not shown You can see this feature in action on the example page for [children shortcode]({{< relref "shortcodes/children" >}}) and its children pages. - -## Your Page - -To configure your page, you basically have three choices: - -1. Create an `_index.md` document in `content` folder and fill the file with *Markdown content* -2. Create an `index.html` file in the `static` folder and fill the file with *HTML content* -3. Configure your server to automatically redirect home page to one your documentation page diff --git a/exampleSite/content/shortcodes/_index.en.md b/exampleSite/content/shortcodes/_index.en.md index 11fb2bba72..78f5eadcfa 100644 --- a/exampleSite/content/shortcodes/_index.en.md +++ b/exampleSite/content/shortcodes/_index.en.md @@ -1,13 +1,10 @@ +++ -chapter = true +archetype = "chapter" +narrow = true title = "Shortcodes" weight = 3 +++ -### Chapter 3 - -# Shortcodes - Hugo uses Markdown for its simple content format. However, there are a lot of things that Markdown doesn’t support well. You could use pure HTML to expand possibilities. But this happens to be a bad idea. Everyone uses Markdown because it's pure and simple to read even non-rendered. You should avoid HTML to keep it as simple as possible. diff --git a/exampleSite/content/shortcodes/_index.pir.md b/exampleSite/content/shortcodes/_index.pir.md index b42797290b..1b4286dbe8 100644 --- a/exampleSite/content/shortcodes/_index.pir.md +++ b/exampleSite/content/shortcodes/_index.pir.md @@ -1,5 +1,6 @@ +++ -chapter = true +archetype = "chapter" +narrow = true title = "Shorrrtcodes" weight = 3 +++ diff --git a/exampleSite/content/tests/_index.en.md b/exampleSite/content/tests/_index.en.md index ba2e5fd6b1..10db936e67 100644 --- a/exampleSite/content/tests/_index.en.md +++ b/exampleSite/content/tests/_index.en.md @@ -1,14 +1,11 @@ +++ -chapter = true +archetype = "chapter" hidden = true +narrow = true title = "Tests" weight = 4 +++ -### Chapter 4 - -# Tests - Some pages for internal testing of differnt styles {{%children containerstyle="div" style="h2" description="true" %}} diff --git a/exampleSite/content/tests/_index.pir.md b/exampleSite/content/tests/_index.pir.md index 5022cbce65..c01a250ea1 100644 --- a/exampleSite/content/tests/_index.pir.md +++ b/exampleSite/content/tests/_index.pir.md @@ -1,7 +1,8 @@ +++ -chapter = true +archetype = "chapter" hidden = true +narrow = true title = "Tests" -weight = 5 +weight = 4 +++ {{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/yours/1.en.md b/exampleSite/content/tests/chapters/1.en.md similarity index 100% rename from exampleSite/content/yours/1.en.md rename to exampleSite/content/tests/chapters/1.en.md diff --git a/exampleSite/content/yours/1.pir.md b/exampleSite/content/tests/chapters/1.pir.md similarity index 100% rename from exampleSite/content/yours/1.pir.md rename to exampleSite/content/tests/chapters/1.pir.md diff --git a/exampleSite/content/yours/10.en.md b/exampleSite/content/tests/chapters/10.en.md similarity index 100% rename from exampleSite/content/yours/10.en.md rename to exampleSite/content/tests/chapters/10.en.md diff --git a/exampleSite/content/yours/10.pir.md b/exampleSite/content/tests/chapters/10.pir.md similarity index 100% rename from exampleSite/content/yours/10.pir.md rename to exampleSite/content/tests/chapters/10.pir.md diff --git a/exampleSite/content/yours/11.de.md b/exampleSite/content/tests/chapters/11.de.md similarity index 100% rename from exampleSite/content/yours/11.de.md rename to exampleSite/content/tests/chapters/11.de.md diff --git a/exampleSite/content/yours/12.de.md b/exampleSite/content/tests/chapters/12.de.md similarity index 100% rename from exampleSite/content/yours/12.de.md rename to exampleSite/content/tests/chapters/12.de.md diff --git a/exampleSite/content/yours/13.de.md b/exampleSite/content/tests/chapters/13.de.md similarity index 100% rename from exampleSite/content/yours/13.de.md rename to exampleSite/content/tests/chapters/13.de.md diff --git a/exampleSite/content/yours/14.de.md b/exampleSite/content/tests/chapters/14.de.md similarity index 100% rename from exampleSite/content/yours/14.de.md rename to exampleSite/content/tests/chapters/14.de.md diff --git a/exampleSite/content/yours/15.de.md b/exampleSite/content/tests/chapters/15.de.md similarity index 100% rename from exampleSite/content/yours/15.de.md rename to exampleSite/content/tests/chapters/15.de.md diff --git a/exampleSite/content/yours/16.de.md b/exampleSite/content/tests/chapters/16.de.md similarity index 100% rename from exampleSite/content/yours/16.de.md rename to exampleSite/content/tests/chapters/16.de.md diff --git a/exampleSite/content/yours/17.de.md b/exampleSite/content/tests/chapters/17.de.md similarity index 100% rename from exampleSite/content/yours/17.de.md rename to exampleSite/content/tests/chapters/17.de.md diff --git a/exampleSite/content/yours/18.de.md b/exampleSite/content/tests/chapters/18.de.md similarity index 100% rename from exampleSite/content/yours/18.de.md rename to exampleSite/content/tests/chapters/18.de.md diff --git a/exampleSite/content/yours/19.de.md b/exampleSite/content/tests/chapters/19.de.md similarity index 100% rename from exampleSite/content/yours/19.de.md rename to exampleSite/content/tests/chapters/19.de.md diff --git a/exampleSite/content/yours/2.en.md b/exampleSite/content/tests/chapters/2.en.md similarity index 100% rename from exampleSite/content/yours/2.en.md rename to exampleSite/content/tests/chapters/2.en.md diff --git a/exampleSite/content/yours/2.pir.md b/exampleSite/content/tests/chapters/2.pir.md similarity index 100% rename from exampleSite/content/yours/2.pir.md rename to exampleSite/content/tests/chapters/2.pir.md diff --git a/exampleSite/content/yours/20.de.md b/exampleSite/content/tests/chapters/20.de.md similarity index 100% rename from exampleSite/content/yours/20.de.md rename to exampleSite/content/tests/chapters/20.de.md diff --git a/exampleSite/content/yours/21.de.md b/exampleSite/content/tests/chapters/21.de.md similarity index 100% rename from exampleSite/content/yours/21.de.md rename to exampleSite/content/tests/chapters/21.de.md diff --git a/exampleSite/content/yours/22.de.md b/exampleSite/content/tests/chapters/22.de.md similarity index 100% rename from exampleSite/content/yours/22.de.md rename to exampleSite/content/tests/chapters/22.de.md diff --git a/exampleSite/content/yours/23.de.md b/exampleSite/content/tests/chapters/23.de.md similarity index 100% rename from exampleSite/content/yours/23.de.md rename to exampleSite/content/tests/chapters/23.de.md diff --git a/exampleSite/content/yours/24.de.md b/exampleSite/content/tests/chapters/24.de.md similarity index 100% rename from exampleSite/content/yours/24.de.md rename to exampleSite/content/tests/chapters/24.de.md diff --git a/exampleSite/content/yours/25.de.md b/exampleSite/content/tests/chapters/25.de.md similarity index 100% rename from exampleSite/content/yours/25.de.md rename to exampleSite/content/tests/chapters/25.de.md diff --git a/exampleSite/content/yours/26.de.md b/exampleSite/content/tests/chapters/26.de.md similarity index 100% rename from exampleSite/content/yours/26.de.md rename to exampleSite/content/tests/chapters/26.de.md diff --git a/exampleSite/content/yours/27.de.md b/exampleSite/content/tests/chapters/27.de.md similarity index 100% rename from exampleSite/content/yours/27.de.md rename to exampleSite/content/tests/chapters/27.de.md diff --git a/exampleSite/content/yours/28.de.md b/exampleSite/content/tests/chapters/28.de.md similarity index 100% rename from exampleSite/content/yours/28.de.md rename to exampleSite/content/tests/chapters/28.de.md diff --git a/exampleSite/content/yours/29.de.md b/exampleSite/content/tests/chapters/29.de.md similarity index 100% rename from exampleSite/content/yours/29.de.md rename to exampleSite/content/tests/chapters/29.de.md diff --git a/exampleSite/content/yours/3.en.md b/exampleSite/content/tests/chapters/3.en.md similarity index 100% rename from exampleSite/content/yours/3.en.md rename to exampleSite/content/tests/chapters/3.en.md diff --git a/exampleSite/content/yours/3.pir.md b/exampleSite/content/tests/chapters/3.pir.md similarity index 100% rename from exampleSite/content/yours/3.pir.md rename to exampleSite/content/tests/chapters/3.pir.md diff --git a/exampleSite/content/yours/30.de.md b/exampleSite/content/tests/chapters/30.de.md similarity index 100% rename from exampleSite/content/yours/30.de.md rename to exampleSite/content/tests/chapters/30.de.md diff --git a/exampleSite/content/yours/4.en.md b/exampleSite/content/tests/chapters/4.en.md similarity index 100% rename from exampleSite/content/yours/4.en.md rename to exampleSite/content/tests/chapters/4.en.md diff --git a/exampleSite/content/yours/4.pir.md b/exampleSite/content/tests/chapters/4.pir.md similarity index 100% rename from exampleSite/content/yours/4.pir.md rename to exampleSite/content/tests/chapters/4.pir.md diff --git a/exampleSite/content/yours/5.en.md b/exampleSite/content/tests/chapters/5.en.md similarity index 100% rename from exampleSite/content/yours/5.en.md rename to exampleSite/content/tests/chapters/5.en.md diff --git a/exampleSite/content/yours/5.pir.md b/exampleSite/content/tests/chapters/5.pir.md similarity index 100% rename from exampleSite/content/yours/5.pir.md rename to exampleSite/content/tests/chapters/5.pir.md diff --git a/exampleSite/content/yours/6.en.md b/exampleSite/content/tests/chapters/6.en.md similarity index 100% rename from exampleSite/content/yours/6.en.md rename to exampleSite/content/tests/chapters/6.en.md diff --git a/exampleSite/content/yours/6.pir.md b/exampleSite/content/tests/chapters/6.pir.md similarity index 100% rename from exampleSite/content/yours/6.pir.md rename to exampleSite/content/tests/chapters/6.pir.md diff --git a/exampleSite/content/yours/7.en.md b/exampleSite/content/tests/chapters/7.en.md similarity index 100% rename from exampleSite/content/yours/7.en.md rename to exampleSite/content/tests/chapters/7.en.md diff --git a/exampleSite/content/yours/7.pir.md b/exampleSite/content/tests/chapters/7.pir.md similarity index 100% rename from exampleSite/content/yours/7.pir.md rename to exampleSite/content/tests/chapters/7.pir.md diff --git a/exampleSite/content/yours/8.en.md b/exampleSite/content/tests/chapters/8.en.md similarity index 100% rename from exampleSite/content/yours/8.en.md rename to exampleSite/content/tests/chapters/8.en.md diff --git a/exampleSite/content/yours/8.pir.md b/exampleSite/content/tests/chapters/8.pir.md similarity index 100% rename from exampleSite/content/yours/8.pir.md rename to exampleSite/content/tests/chapters/8.pir.md diff --git a/exampleSite/content/yours/9.en.md b/exampleSite/content/tests/chapters/9.en.md similarity index 100% rename from exampleSite/content/yours/9.en.md rename to exampleSite/content/tests/chapters/9.en.md diff --git a/exampleSite/content/yours/9.pir.md b/exampleSite/content/tests/chapters/9.pir.md similarity index 100% rename from exampleSite/content/yours/9.pir.md rename to exampleSite/content/tests/chapters/9.pir.md diff --git a/exampleSite/content/tests/chapters/_index.en.md b/exampleSite/content/tests/chapters/_index.en.md new file mode 100644 index 0000000000..3d4500eb49 --- /dev/null +++ b/exampleSite/content/tests/chapters/_index.en.md @@ -0,0 +1,6 @@ ++++ +alwaysopen = false +title = "Chapters" ++++ + +Start your success story. Now! \ No newline at end of file diff --git a/exampleSite/content/tests/chapters/_index.pir.md b/exampleSite/content/tests/chapters/_index.pir.md new file mode 100644 index 0000000000..dd2155734c --- /dev/null +++ b/exampleSite/content/tests/chapters/_index.pir.md @@ -0,0 +1,5 @@ ++++ +alwaysopen = false +title = "Chapters" ++++ +{{< piratify >}} \ No newline at end of file diff --git a/exampleSite/content/yours/children-1/_index.en.md b/exampleSite/content/tests/chapters/children-1/_index.en.md similarity index 100% rename from exampleSite/content/yours/children-1/_index.en.md rename to exampleSite/content/tests/chapters/children-1/_index.en.md diff --git a/exampleSite/content/yours/children-1/_index.pir.md b/exampleSite/content/tests/chapters/children-1/_index.pir.md similarity index 100% rename from exampleSite/content/yours/children-1/_index.pir.md rename to exampleSite/content/tests/chapters/children-1/_index.pir.md diff --git a/exampleSite/content/yours/_index.en.md b/exampleSite/content/yours/_index.en.md deleted file mode 100644 index 855d6c469e..0000000000 --- a/exampleSite/content/yours/_index.en.md +++ /dev/null @@ -1,12 +0,0 @@ -+++ -chapter = true -hidden = true -title = "This could be yours" -weight = 4 -+++ - -### Chapter 4 - -# This could be yours - -Start your success story. Now! \ No newline at end of file diff --git a/exampleSite/content/yours/_index.pir.md b/exampleSite/content/yours/_index.pir.md deleted file mode 100644 index 8c1f2ed730..0000000000 --- a/exampleSite/content/yours/_index.pir.md +++ /dev/null @@ -1,7 +0,0 @@ -+++ -chapter = true -hidden = true -title = "This could be yers" -weight = 4 -+++ -{{< piratify >}} \ No newline at end of file diff --git a/exampleSite/layouts/partials/menu-pre.html b/exampleSite/layouts/partials/menu-pre.html index 7da24c4209..33cb6ef90f 100644 --- a/exampleSite/layouts/partials/menu-pre.html +++ b/exampleSite/layouts/partials/menu-pre.html @@ -1 +1 @@ -{{ if .Params.chapter }}{{ .Params.weight }}. {{ end }} \ No newline at end of file +{{ if (eq .Params.archetype "chapter") }}{{ .Params.weight }}. {{ end }} \ No newline at end of file diff --git a/i18n/ar.toml b/i18n/ar.toml index c931477cc9..7517e83480 100644 --- a/i18n/ar.toml +++ b/i18n/ar.toml @@ -66,3 +66,6 @@ other = "نسخ الرابط إلى الحافظة" [Link-copied-to-clipboard] other = "رابط نسخت إلى الحافظة!" + +[Chapter] +other = "{{.}} الفصل" diff --git a/i18n/de.toml b/i18n/de.toml index 4fc1fd34ad..252c73a871 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -66,3 +66,6 @@ other = "Link in Zwischenablage kopieren" [Link-copied-to-clipboard] other = "Link in Zwischenablage kopiert!" + +[Chapter] +other = "Kapitel {{.}}" diff --git a/i18n/en.toml b/i18n/en.toml index 93b46c3c6f..4761063973 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -66,3 +66,6 @@ other = "Copy link to clipboard" [Link-copied-to-clipboard] other = "Copied link to clipboard!" + +[Chapter] +other = "Chapter {{.}}" diff --git a/i18n/es.toml b/i18n/es.toml index d3ec84acbc..65387f7390 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -66,3 +66,6 @@ other = "Copiar enlace al portapapeles" [Link-copied-to-clipboard] other = "¡Enlace copiado al portapapeles!" + +[Chapter] +other = "Capitulo {{.}}" diff --git a/i18n/fr.toml b/i18n/fr.toml index 6b6cc5532f..782ec13bbd 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -66,3 +66,6 @@ other = "Copier le lien dans le presse-papiers" [Link-copied-to-clipboard] other = "Lien copié dans le presse-papiers!" + +[Chapter] +other = "Chapitre {{.}}" diff --git a/i18n/hi.toml b/i18n/hi.toml index 449d40e8aa..9ec1eaed9e 100644 --- a/i18n/hi.toml +++ b/i18n/hi.toml @@ -66,3 +66,6 @@ other = "क्लिपबोर्ड पर लिंक की प्रत [Link-copied-to-clipboard] other = "लिंक क्लिपबोर्ड के लिए प्रतिलिपि बनाई!" + +[Chapter] +other = "अध्याय {{.}}" diff --git a/i18n/id.toml b/i18n/id.toml index 1555fcb608..05e89d8306 100644 --- a/i18n/id.toml +++ b/i18n/id.toml @@ -66,3 +66,6 @@ other = "Salin link ke clipboard" [Link-copied-to-clipboard] other = "Link disalin ke clipboard!" + +[Chapter] +other = "Bab {{.}}" diff --git a/i18n/it.toml b/i18n/it.toml index a723f27b59..1f3634d313 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -66,3 +66,6 @@ other = "Copia collegamento in clipboard" [Link-copied-to-clipboard] other = "Collegamento copiato dalla clipboard!" + +[Chapter] +other = "Capitolo {{.}}" diff --git a/i18n/ja.toml b/i18n/ja.toml index 86e0ca9689..86c5f11900 100644 --- a/i18n/ja.toml +++ b/i18n/ja.toml @@ -66,3 +66,6 @@ other = "リンクをクリップボードにコピー" [Link-copied-to-clipboard] other = "リンクをクリップボードにコピーしました!" + +[Chapter] +other = "第{{.}}章" diff --git a/i18n/kr.toml b/i18n/kr.toml index d7f95c29b9..8b46bc84a0 100644 --- a/i18n/kr.toml +++ b/i18n/kr.toml @@ -69,3 +69,6 @@ other = "링크를 클립보드에 복사" [Link-copied-to-clipboard] other = "클립보드에 링크가 복사됐습니다!" + +[Chapter] +other = "{{.}}장" diff --git a/i18n/nl.toml b/i18n/nl.toml index 39c338e366..e96806994f 100644 --- a/i18n/nl.toml +++ b/i18n/nl.toml @@ -66,3 +66,6 @@ other = "Link naar klembord kopiëren" [Link-copied-to-clipboard] other = "Link gekopieerd naar klembord!" + +[Chapter] +other = "Hoofdstuk {{.}}" diff --git a/i18n/pir.toml b/i18n/pir.toml index 57e9dd0c6e..caa980adc1 100644 --- a/i18n/pir.toml +++ b/i18n/pir.toml @@ -66,3 +66,6 @@ other = "Copy link t' clipboard" [Link-copied-to-clipboard] other = "Copied link t' clipboard!" + +[Chapter] +other = "T' chapterrr {{.}}" diff --git a/i18n/pl.toml b/i18n/pl.toml index b6ce7d98ea..e92cd9c29d 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -66,3 +66,6 @@ other = "Kopiuj link do schowka" [Link-copied-to-clipboard] other = "Skopiowano link do schowka!" + +[Chapter] +other = "Rozdział {{.}}" diff --git a/i18n/pt.toml b/i18n/pt.toml index 414c6638e4..e759a3dcf8 100644 --- a/i18n/pt.toml +++ b/i18n/pt.toml @@ -66,3 +66,6 @@ other = "Link de cópia para a área de transferência" [Link-copied-to-clipboard] other = "Link copiado para a área de transferência!" + +[Chapter] +other = "Capítulo {{.}}" diff --git a/i18n/ru.toml b/i18n/ru.toml index bc4fd25f7f..3016c047c4 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -66,3 +66,6 @@ other = "Скопировать ссылку в буфер обмена" [Link-copied-to-clipboard] other = "Ссылка скопирована в буфер обмена!" + +[Chapter] +other = "Глава {{.}}" diff --git a/i18n/tr.toml b/i18n/tr.toml index ea443ae19c..a98e6207e4 100644 --- a/i18n/tr.toml +++ b/i18n/tr.toml @@ -66,3 +66,6 @@ other = "Bağlantıyı panoya kopyala" [Link-copied-to-clipboard] other = "Panoya bağlantı kopyalanmış!" + +[Chapter] +other = "{{.}}. Bölüm" diff --git a/i18n/vi.toml b/i18n/vi.toml index bfb5e41dda..2ef1e39b8c 100644 --- a/i18n/vi.toml +++ b/i18n/vi.toml @@ -69,3 +69,6 @@ other = "Sao chép nối kết vào bảng tạm" [Link-copied-to-clipboard] other = "Liên kết được sao chép vào bảng tạm!" + +[Chapter] +other = "Chương {{.}}" diff --git a/i18n/zh-cn.toml b/i18n/zh-cn.toml index 3227877081..a4a6fcbeac 100644 --- a/i18n/zh-cn.toml +++ b/i18n/zh-cn.toml @@ -66,3 +66,6 @@ other = "将链接复制到剪贴板" [Link-copied-to-clipboard] other = "链接复制到剪贴板!" + +[Chapter] +other = "第{{.}}章" diff --git a/i18n/zh-tw.toml b/i18n/zh-tw.toml index adfb430edf..24f204a079 100644 --- a/i18n/zh-tw.toml +++ b/i18n/zh-tw.toml @@ -66,3 +66,6 @@ other = "將連結複製到剪貼簿" [Link-copied-to-clipboard] other = "連結複製到剪貼簿!" + +[Chapter] +other = "第{{.}}章" diff --git a/i18n/zh.toml b/i18n/zh.toml index 3227877081..a4a6fcbeac 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -66,3 +66,6 @@ other = "将链接复制到剪贴板" [Link-copied-to-clipboard] other = "链接复制到剪贴板!" + +[Chapter] +other = "第{{.}}章" diff --git a/layouts/partials/archetypes/chapter-deprecated.html b/layouts/partials/archetypes/chapter-deprecated.html new file mode 100644 index 0000000000..809d76f28e --- /dev/null +++ b/layouts/partials/archetypes/chapter-deprecated.html @@ -0,0 +1,10 @@ +{{- $content := .content }} +{{- with .page }} +
+ +{{ $content | safeHTML }} +
+ {{- partial "content-footer.html" . }} +
+
+{{- end }} diff --git a/layouts/partials/archetypes/chapter.html b/layouts/partials/archetypes/chapter.html new file mode 100644 index 0000000000..04f0696290 --- /dev/null +++ b/layouts/partials/archetypes/chapter.html @@ -0,0 +1,12 @@ +{{- $content := .content }} +{{- with .page }} +
+ +{{- partial "heading-pre.html" . }}
{{ T "Chapter" .Params.Weight }}
+

{{ .Title }}

{{- partial "heading-post.html" . }} +{{ $content | safeHTML }} +
+ {{- partial "content-footer.html" . }} +
+
+{{- end }} diff --git a/layouts/partials/archetypes/default.html b/layouts/partials/archetypes/default.html new file mode 100644 index 0000000000..c3c90e0cd4 --- /dev/null +++ b/layouts/partials/archetypes/default.html @@ -0,0 +1,11 @@ +{{- $content := .content }} +{{- with .page }} +
+ +{{- partial "heading-pre.html" . }}

{{ .Title }}

{{- partial "heading-post.html" . }} +{{ $content | safeHTML }} +
+ {{- partial "content-footer.html" . }} +
+
+{{- end }} diff --git a/layouts/partials/archetypes/home-deprecated.html b/layouts/partials/archetypes/home-deprecated.html new file mode 100644 index 0000000000..16ccd303cf --- /dev/null +++ b/layouts/partials/archetypes/home-deprecated.html @@ -0,0 +1,10 @@ +{{- $content := .content }} +{{- with .page }} +
+ +{{ $content | safeHTML }} +
+ {{- partial "content-footer.html" . }} +
+
+{{- end }} diff --git a/layouts/partials/archetypes/home.html b/layouts/partials/archetypes/home.html new file mode 100644 index 0000000000..7633ee5eb7 --- /dev/null +++ b/layouts/partials/archetypes/home.html @@ -0,0 +1,11 @@ +{{- $content := .content }} +{{- with .page }} +
+ +{{- partial "heading-pre.html" . }}

{{ .Title }}

{{- partial "heading-post.html" . }} +{{ $content | safeHTML }} +
+ {{- partial "content-footer.html" . }} +
+
+{{- end }} diff --git a/layouts/partials/article.html b/layouts/partials/article.html index 17e89cfb96..31ee4f960b 100644 --- a/layouts/partials/article.html +++ b/layouts/partials/article.html @@ -1,11 +1,12 @@ -{{- $content := .content }} -{{- with .page }} - - -{{ if and (not .IsHome ) (not .Params.chapter) }}{{- partial "heading-pre.html" . }}

{{ .Title }}

{{- partial "heading-post.html" . }} -{{ end }}{{ $content | safeHTML }} -
- {{- partial "content-footer.html" . }} -
- -{{- end }} \ No newline at end of file +{{- $archetype := "default" }} +{{- if .page.Params.archetype }} + {{- $archetype = .page.Params.archetype }} +{{- else if .page.Params.chapter }} + {{- $archetype = "chapter-deprecated" }} +{{- else if .page.IsHome }} + {{- $archetype = "home-deprecated" }} +{{- end }} +{{- if not (fileExists (printf "/layouts/partials/archetypes/%s.html" $archetype)) }} + {{- $archetype = "default" }} +{{- end }} +{{- partial (printf "archetypes/%s.html" $archetype) (dict "page" .page "content" .content) }} \ No newline at end of file diff --git a/layouts/partials/body.print.html b/layouts/partials/body.print.html index 936394daff..00a0c33ead 100644 --- a/layouts/partials/body.print.html +++ b/layouts/partials/body.print.html @@ -18,7 +18,7 @@ {{- else }} {{- if $isActive }} {{- template "section-print" dict "sect" . "currentnode" $currentNode }} - {{- if or .IsHome .Params.chapter $pages }} + {{- if or $pages }}
{{- end }} {{- end }} @@ -32,7 +32,7 @@ {{- end }} {{- end }} {{- if $isActive }} - {{- if or .IsHome .Params.chapter $pages }} + {{- if $pages }}
{{- end }} {{- end }} @@ -59,7 +59,7 @@ {{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }} {{- if $isActive }} {{- template "section-print" dict "sect" . "currentnode" $currentNode }} - {{- if or .IsHome .Params.chapter $pages }} + {{- if $pages }}
{{- end }} {{- end }} @@ -73,7 +73,7 @@ {{- end }} {{- end }} {{- if $isActive }} - {{- if or .IsHome .Params.chapter $pages }} + {{- if $pages }}
{{- end }} {{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 64a7ffe7aa..82c0c94631 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -79,7 +79,7 @@ {{- $defaultDisableToc := .Site.Params.disableToc | default false }} {{- $currentDisableToc := .Params.disableToc | default $defaultDisableToc }} {{- $hastoc := not (eq 0 (int (len (.TableOfContents | plainify)))) }} - {{- $toc := (and $hastoc (not $currentDisableToc) (not .Params.chapter)) }} + {{- $toc := (and $hastoc (not $currentDisableToc)) }} -
+
{{- partial "tags.html" . }} diff --git a/static/css/ie.css b/static/css/ie.css index eb91cb2867..c024c4170b 100644 --- a/static/css/ie.css +++ b/static/css/ie.css @@ -80,7 +80,8 @@ font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; /* var(--MAIN-font) */ } - h2, h3, h4, h5, h6 { + h2, h3, .article-subheading, h4, h5, h6 { + { color: #4a4a4a; /* var(--MAIN-TITLES-TEXT-color) */ font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; /* var(--MAIN-TITLES-TEXT-font) */ } diff --git a/static/css/nucleus.css b/static/css/nucleus.css index f03efd75d5..2418241f50 100644 --- a/static/css/nucleus.css +++ b/static/css/nucleus.css @@ -180,7 +180,7 @@ body { font-size: 1rem; line-height: 1.5; } -h1, h2, h3, h4, h5, h6 { +h1, h2, h3, .article-subheading, h4, h5, h6 { margin: 0.85rem 0 1rem 0; text-rendering: optimizeLegibility; } @@ -190,7 +190,7 @@ h1 { h2 { font-size: 2.55rem; } -h3 { +h3, .article-subheading { font-size: 2.15rem; } h4 { diff --git a/static/css/print.css b/static/css/print.css index 6cebb66d8a..4ef812123d 100644 --- a/static/css/print.css +++ b/static/css/print.css @@ -54,7 +54,7 @@ pre { display: none; } -#body h1, #body h2, #body h3, #body h4, #body h5, #body h6 { +#body h1, #body h2, #body h3, #body .article-subheading, #body h4, #body h5, #body h6 { /* better contrast for colored elements */ color: black; } @@ -93,10 +93,12 @@ body, margin-bottom: 2rem; padding-bottom: .75rem; } -#body-inner .chapter h3:first-of-type { + +#body-inner div.article-subheading, +#body-inner .chapter.deprecated h3:first-of-type { margin-top: 2rem; } -#body-inner .chapter p { +#body-inner.narrow p { font-size: 1rem; } diff --git a/static/css/theme-neon.css b/static/css/theme-neon.css index 62f8855f52..fcec0e8cb8 100644 --- a/static/css/theme-neon.css +++ b/static/css/theme-neon.css @@ -106,7 +106,7 @@ body h2 { 0 0 10px var(--INTERNAL-MAIN-TITLES-H2-color); } -body h3 { +body h3, body .article-subheading { color: #fff; text-shadow: 0 0 1px #fff, @@ -228,7 +228,7 @@ body .box.cstyle.transparent { @media print { #body h1, #body h2, - #body h3, + #body h3, #body .article-subheading, #body h4, #body h5, #body h6 { @@ -246,7 +246,7 @@ body .box.cstyle.transparent { above will not apply, so we have to repeat it here */ .print #body h1, .print #body h2, -.print #body h3, +.print #body h3, .print #body .article-subheading, .print #body h4, .print #body h5, .print #body h6 { diff --git a/static/css/theme.css b/static/css/theme.css index fb628693e8..b715304e29 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -60,16 +60,16 @@ body { width: 100%; } -body #body-inner .chapter h1 { +body #body-inner.narrow h1 { font-size: 3.5rem; } @media only screen and (min-width: 48em) and (max-width: 59.938em) { - body #body-inner .chapter h1 { + body #body-inner.narrow h1 { font-size: 2.8rem; } } @media only screen and (max-width: 47.938em) { - body #body-inner .chapter h1 { + body #body-inner.narrow h1 { font-size: 2.5rem; } } @@ -399,34 +399,35 @@ th { } } -#body-inner.chapter { +#body-inner.narrow { margin-left: auto; margin-right: auto; padding: 2rem 9.75rem; } @media screen and (max-width: 59.938em) { - #body-inner.chapter { + #body-inner.narrow { padding: 15px 6.5rem 15px 6.5rem; } } @media screen and (max-width: 47.938em) { - #body-inner.chapter { + #body-inner.narrow { padding: 5px 3.25rem 5px 3.25rem; } } -#body-inner .chapter h3:first-of-type { +#body-inner div.article-subheading, +#body-inner .chapter.deprecated h3:first-of-type { font-weight: 200; margin-top: 0; text-align: center; } -#body-inner .chapter h1 { +#body-inner.narrow h1 { border-bottom: 4px solid rgba( 134, 134, 134, .125 ); font-size: 5rem; } -#body-inner .chapter p { +#body-inner.narrow p { font-size: 1.2rem; text-align: justify; } @@ -437,7 +438,7 @@ h1 { text-transform: uppercase; } -h2, h3, h4, h5, h6 { +h2, h3, .article-subheading, h4, h5, h6 { letter-spacing: -1px; text-rendering: optimizeLegibility; } @@ -608,7 +609,8 @@ hr { #body-inner h3, #body-inner h4, #body-inner h5, -#body-inner h6 { +#body-inner h6, +#body-inner .article-subheading { /* big titles cause a horizontal scrollbar - fixing this by wrapping text */ overflow-wrap: break-word; overflow-x: hidden; @@ -1268,7 +1270,7 @@ h6 a { margin-top: 2rem; } -#body h3 { +#body h3, #body .article-subheading { font-size: 1.8rem; font-weight: 500; margin-top: 2rem; diff --git a/static/css/variant.css b/static/css/variant.css index dff2603741..648d8f28c6 100644 --- a/static/css/variant.css +++ b/static/css/variant.css @@ -174,7 +174,7 @@ h2 { font-family: var(--INTERNAL-MAIN-TITLES-H2-font); } -h3 { +h3, .article-subheading { color: var(--INTERNAL-MAIN-TITLES-H3-color); font-family: var(--INTERNAL-MAIN-TITLES-H3-font); }