diff --git a/docs/content/configuration/customization/designs/index.en.md b/docs/content/configuration/customization/designs/index.en.md index 10f1a32e28..a6582cf0f5 100644 --- a/docs/content/configuration/customization/designs/index.en.md +++ b/docs/content/configuration/customization/designs/index.en.md @@ -33,9 +33,9 @@ The shipped `print` and `markdown` output formats only display using the `defaul Suppose you are writing a documentation site for some software. Each time a new release is created, you are adding a new releasenotes page to your site. Those pages should contain a common disclaimer at the top. You neither want to copy the text into each new file nor want you to use a shortcode but create a page design called `releasenotes`. 1. Choose a name (here, `releasenotes`) -2. Create a content view file at `layouts/releasenotes/views/article.html` +2. Create a content view file at `layouts/releasenotes/article.html` - ````html {title="layouts/releasenotes/views/article.html" hl_Lines="6-8"} + ````html {title="layouts/releasenotes/article.html" hl_Lines="6-8"} <article class="releasenotes"> <header class="headline"> {{partial "content-header.html" .}} @@ -51,7 +51,7 @@ Suppose you are writing a documentation site for some software. Each time a new </article> ```` - The marked lines are your customizations, the rest of the file was copied over from the default implementation of [`layouts/_default/views/article.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/views/article.html) + The marked lines are your customizations, the rest of the file was copied over from the default implementation of [`layouts/_default/article.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/article.html) In this file, you can customize the page structure as needed. For HTML based output formats, typically you'll want to: @@ -92,20 +92,20 @@ These files are common for all output formats. If you want to keep the general HTML framework and only change specific parts, you can provide these files for the page desingn for the HTML output format independently of one another. -- `layouts/<DESIGN>/views/article.html`: _Optional_: Controls how one page's content and title are displayed -- `layouts/<DESIGN>/views/body.html`: _Optional_: Determines what to contain in the content area (for example a single page, a list of pages, a tree of sub pages) -- `layouts/<DESIGN>/views/menu.html`: _Optional_: Defines the sidebar menu layout +- `layouts/<DESIGN>/article.html`: _Optional_: Controls how one page's content and title are displayed +- `layouts/<DESIGN>/body.html`: _Optional_: Determines what to contain in the content area (for example a single page, a list of pages, a tree of sub pages) +- `layouts/<DESIGN>/menu.html`: _Optional_: Defines the sidebar menu layout For a real-world example, check out the `changelog` page design implementation -- [`docs/layouts/changelog/views/article.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/docs/layouts/changelog/views/article.html) +- [`docs/layouts/changelog/article.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/docs/layouts/changelog/article.html) ## Migration to Relearn 7 or higher Previous to Relearn 7, page designs were defined by a proprietary solution unique to the theme. Depending on your modifications you may have to change some or all of the following to migrate to Relearn 7's page designs. - In all your `*.md` files, replace the `archetype` front matter with `type`; the value stays the same; don't forget your archetype files if you have some -- Move your files `layouts/partials/archetypes/<DESIGN>/article.html` to `layouts/<DESIGN>/views/article.html` +- Move your files `layouts/partials/archetypes/<DESIGN>/article.html` to `layouts/<DESIGN>/article.html` The files will most likely require further modifications as they now receive the page as it context (dot `.`) instead of the `.page` and `.content` parameter. @@ -132,7 +132,7 @@ Previous to Relearn 7, page designs were defined by a proprietary solution uniqu **New**: - ````html {title="layouts/<DESIGN>/views/article.html" hl_Lines="7"} + ````html {title="layouts/<DESIGN>/article.html" hl_Lines="7"} <article class="default"> <header class="headline"> {{- partial "content-header.html" . }} diff --git a/docs/content/configuration/customization/outputformats/_index.en.md b/docs/content/configuration/customization/outputformats/_index.en.md index fa1491ad9f..1df24a5a11 100644 --- a/docs/content/configuration/customization/outputformats/_index.en.md +++ b/docs/content/configuration/customization/outputformats/_index.en.md @@ -60,11 +60,11 @@ Therefore we add a new output format called `email` that outputs HTML and assemb The marked `block` construct above will cause the display of the article with a default HTML structure. In case you want to keep it really simple, you could replace this line with just `{{ .Content }}`. -3. _Optional_: create a file `layouts/_default/views/article.email.html` +3. _Optional_: create a file `layouts/_default/article.email.html` In our case, we want to display a disclaimer in front of every article. To do this we have to define the output of an article ourself and rely on the above `block` statement to call our template. - ````html {title="layouts/_default/views/article.email.html"} + ````html {title="layouts/_default/article.email.html"} <article class="email"> <blockquote> View this article on <a href="http://example.com{{ .RelPermalink }}">our website</a> @@ -100,16 +100,16 @@ Therefore we add a new output format called `email` that outputs HTML and assemb If you want to keep the general HTML framework and only change specific parts, you can provide these files for your output format independently of one another: -- `layouts/_default/views/article.<FORMAT>.html`: _Optional_: Controls how a page's content and title are displayed -- `layouts/_default/views/body.<FORMAT>.html`: _Optional_: Determines what to contain in the content area (for example a single page, a list of pages, a tree of sub pages) -- `layouts/_default/views/menu.<FORMAT>.html`: _Optional_: Defines the sidebar menu layout -- `layouts/_default/views/storeOutputFormat.<FORMAT>.html`: _Optional_: Stores the output format name for use in the framework to let the body element been marked with an output format specific class +- `layouts/_default/article.<FORMAT>.html`: _Optional_: Controls how a page's content and title are displayed +- `layouts/_default/body.<FORMAT>.html`: _Optional_: Determines what to contain in the content area (for example a single page, a list of pages, a tree of sub pages) +- `layouts/_default/menu.<FORMAT>.html`: _Optional_: Defines the sidebar menu layout +- `layouts/_default/storeOutputFormat.<FORMAT>.html`: _Optional_: Stores the output format name for use in the framework to let the body element been marked with an output format specific class For a real-world example, check out the `print` output format implementation -- [`layouts/_default/views/body.print.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/views/body.print.html) -- [`layouts/_default/views/menu.print.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/views/menu.print.html) -- [`layouts/_default/views/storeOutputFormat.print.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/views/storeOutputFormat.print.html) +- [`layouts/_default/body.print.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/body.print.html) +- [`layouts/_default/menu.print.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/menu.print.html) +- [`layouts/_default/storeOutputFormat.print.html`](https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/_default/storeOutputFormat.print.html) ### For Non-HTML Output Formats @@ -129,7 +129,7 @@ Previous to Relearn 7, HTML output formats did not use the `baseof.html` but now ### For HTML Output Formats -- Move your files `layouts/partials/article.<FORMAT>.html` to `layouts/_default/views/article.<FORMAT>.html` +- Move your files `layouts/partials/article.<FORMAT>.html` to `layouts/_default/article.<FORMAT>.html` The files will most likely require further modifications as they now receive the page as it context (dot `.`) instead of the `.page` and `.content` parameter. @@ -156,7 +156,7 @@ Previous to Relearn 7, HTML output formats did not use the `baseof.html` but now **New**: - ````html {title="layouts/_default/views/article.<FORMAT>.html" hl_Lines="7"} + ````html {title="layouts/_default/article.<FORMAT>.html" hl_Lines="7"} <article class="default"> <header class="headline"> {{- partial "content-header.html" . }} @@ -204,7 +204,7 @@ Previous to Relearn 7, HTML output formats did not use the `baseof.html` but now The upper part of the file is from your `header.<FORMAT>.html` and the lower part is from your `footer.<FORMAT>.html`. - The marked line needs to be added, so your output format uses a potential `layouts/_default/views/article.<FORMAT>.html` + The marked line needs to be added, so your output format uses a potential `layouts/_default/article.<FORMAT>.html` ````html {title="layouts/_default/baseof.<FORMAT>.html" hl_Lines="15"} <!DOCTYPE html> diff --git a/docs/layouts/changelog/views/article.html b/docs/layouts/changelog/article.html similarity index 100% rename from docs/layouts/changelog/views/article.html rename to docs/layouts/changelog/article.html diff --git a/docs/layouts/releasenotes/views/article.html b/docs/layouts/releasenotes/article.html similarity index 100% rename from docs/layouts/releasenotes/views/article.html rename to docs/layouts/releasenotes/article.html diff --git a/layouts/_default/views/article.html b/layouts/_default/article.html similarity index 100% rename from layouts/_default/views/article.html rename to layouts/_default/article.html diff --git a/layouts/_default/views/body.html b/layouts/_default/body.html similarity index 100% rename from layouts/_default/views/body.html rename to layouts/_default/body.html diff --git a/layouts/_default/views/body.print.html b/layouts/_default/body.print.html similarity index 100% rename from layouts/_default/views/body.print.html rename to layouts/_default/body.print.html diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 21509c74c7..6f086750bc 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,9 +1,9 @@ {{- define "storeOutputFormat" }} - {{- .Render "views/storeOutputFormat" }} + {{- .Render "storeOutputFormat" }} {{- end }} {{- define "body" }} - {{- .Render "views/body" }} + {{- .Render "body" }} {{- end }} {{- define "menu" }} - {{- .Render "views/menu" }} + {{- .Render "menu" }} {{- end }} \ No newline at end of file diff --git a/layouts/_default/views/menu.html b/layouts/_default/menu.html similarity index 100% rename from layouts/_default/views/menu.html rename to layouts/_default/menu.html diff --git a/layouts/_default/views/menu.print.html b/layouts/_default/menu.print.html similarity index 100% rename from layouts/_default/views/menu.print.html rename to layouts/_default/menu.print.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 21509c74c7..6f086750bc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,9 +1,9 @@ {{- define "storeOutputFormat" }} - {{- .Render "views/storeOutputFormat" }} + {{- .Render "storeOutputFormat" }} {{- end }} {{- define "body" }} - {{- .Render "views/body" }} + {{- .Render "body" }} {{- end }} {{- define "menu" }} - {{- .Render "views/menu" }} + {{- .Render "menu" }} {{- end }} \ No newline at end of file diff --git a/layouts/_default/views/storeOutputFormat.html b/layouts/_default/storeOutputFormat.html similarity index 100% rename from layouts/_default/views/storeOutputFormat.html rename to layouts/_default/storeOutputFormat.html diff --git a/layouts/_default/views/storeOutputFormat.print.html b/layouts/_default/storeOutputFormat.print.html similarity index 100% rename from layouts/_default/views/storeOutputFormat.print.html rename to layouts/_default/storeOutputFormat.print.html diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index e995a03c05..7e65a839be 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -1,9 +1,9 @@ {{- define "storeOutputFormat" }} - {{- .Render "views/storeOutputFormat" }} + {{- .Render "storeOutputFormat" }} {{- end }} {{- define "body" }} {{- partial "bodys/taxonomy.html" . }} {{- end }} {{- define "menu" }} - {{- .Render "views/menu" }} + {{- .Render "menu" }} {{- end }} \ No newline at end of file diff --git a/layouts/_default/term.html b/layouts/_default/term.html index eafcaab0f4..b26742a934 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -1,9 +1,9 @@ {{- define "storeOutputFormat" }} - {{- .Render "views/storeOutputFormat" }} + {{- .Render "storeOutputFormat" }} {{- end }} {{- define "body" }} {{- partial "bodys/term.html" . }} {{- end }} {{- define "menu" }} - {{- .Render "views/menu" }} + {{- .Render "menu" }} {{- end }} \ No newline at end of file diff --git a/layouts/_relearn_searchform/views/article.html b/layouts/_relearn_searchform/article.html similarity index 100% rename from layouts/_relearn_searchform/views/article.html rename to layouts/_relearn_searchform/article.html diff --git a/layouts/chapter/views/article.html b/layouts/chapter/article.html similarity index 100% rename from layouts/chapter/views/article.html rename to layouts/chapter/article.html diff --git a/layouts/home/views/article.html b/layouts/home/article.html similarity index 100% rename from layouts/home/views/article.html rename to layouts/home/article.html diff --git a/layouts/partials/bodys/single.html b/layouts/partials/bodys/single.html index 683da10ecd..01b177aeb7 100644 --- a/layouts/partials/bodys/single.html +++ b/layouts/partials/bodys/single.html @@ -1,2 +1,2 @@ {{- .Store.Set "relearnIsNested" false }} -{{- .Render "views/article" }} \ No newline at end of file +{{- .Render "article" }} \ No newline at end of file diff --git a/layouts/partials/bodys/tree.html b/layouts/partials/bodys/tree.html index 7cbee6739a..0bb2524519 100644 --- a/layouts/partials/bodys/tree.html +++ b/layouts/partials/bodys/tree.html @@ -18,7 +18,7 @@ {{- $article := "" }} {{- if .Title }} - {{- $article = .Render "views/article" }} + {{- $article = .Render "article" }} {{- end }} {{- if len $html }} {{- $title := partial "title.gotmpl" (dict "page" . "linkTitle" true) }} diff --git a/layouts/partials/stylesheet.html b/layouts/partials/stylesheet.html index c85fd91e26..b5bdefd87f 100644 --- a/layouts/partials/stylesheet.html +++ b/layouts/partials/stylesheet.html @@ -2,7 +2,7 @@ {{- with .Store.Get "relearnOutputFormat" }} {{- $outputFormat = . }} {{- else }} - {{- warnf "WARNING no key `relearnOutputFormat` found in page store, set one by providing the file `layouts/_default/view/storeOutputFormat.<MYOUTPUTFORMAT>.html` for your self-defined output format; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0" }} + {{- warnf "WARNING no key `relearnOutputFormat` found in page store, set one by providing the file `layouts/_default/storeOutputFormat.<MYOUTPUTFORMAT>.html` for your self-defined output format; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0" }} {{- end }} {{- $assetBusting := partialCached "assetbusting.gotmpl" . }} {{- $minify := not hugo.IsServer }} diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index f7b284a7f9..f5207a0baf 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.6.1+b0c6bb558d7728ac4535a2ac677c5f47297203cc \ No newline at end of file +7.6.1+fd809dc523623e504d4c4ad775d026fe85197679 \ No newline at end of file