Skip to content

Commit 484ce3d

Browse files
committed
docs: clarify limitations attachments shortcode in Hugo <0.112 matcornic#540
1 parent 7ec7e17 commit 484ce3d

File tree

10 files changed

+35
-24
lines changed

10 files changed

+35
-24
lines changed

exampleSite/content/basics/migration/_index.en.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ This document shows you what's new in the latest release. For a detailed list of
2020

2121
## 5.15.0 (2023-05-25)
2222

23+
- {{% badge style="note" title=" " %}}Change{{% /badge %}} Now also compatible with Hugo {{% badge color="fuchsia" icon="fab fa-hackerrank" title=" " %}}0.112.0{{% /badge %}} or higher. This does not change the minimum required Hugo version.
24+
25+
The [`attachments` shortcode]({{% relref "shortcodes/attachments" %}}) has compatiblity issues with newer Hugo versions. You must switch to leaf bundles or are locked to Hugo < `0.112.0` for now.
26+
27+
It is [planned to refactor](https://github.com/McShelby/hugo-theme-relearn/issues/22) the `attchments` shortcode in the future. This will make it possible to use the shortcode in branch bundles again but not in simple pages anymore. Sadly this most likely will come with a breaking change which requires you to make changes to your project.
28+
2329
- {{% badge style="note" title=" " %}}Change{{% /badge %}} The [`tabs` shortcode]({{% relref "shortcodes/tabs" %}}) has changed behavior if you haven't set the `groupid` parameter.
2430

2531
Formerly all tab views without a `groupid` were treated as so they belong to the same group. Now, each tab view is treated as it was given a unique id.
@@ -28,8 +34,6 @@ This document shows you what's new in the latest release. For a detailed list of
2834

2935
Additionally for such a use case, the whitespace between a tab outline and the code is removed if only a single code block is contained.
3036

31-
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Now also compatible with {{% badge color="fuchsia" icon="fab fa-hackerrank" title=" " %}}0.112.0{{% /badge %}} or higher. This does not change the minimum required Hugo version.
32-
3337
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Besides the _tag_ [taxonomy]({{% relref "cont/taxonomy" %}}) the theme now also provides the _category_ taxonomy out of the box and shows them in the content footer of each page.
3438

3539
---

exampleSite/content/shortcodes/attachments.en.md renamed to exampleSite/content/shortcodes/attachments/index.en.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ The `attachments` shortcode displays a list of files attached to a page with adj
77

88
{{% attachments sort="asc" /%}}
99

10+
{{% notice warning %}}
11+
Since Hugo {{% badge color="fuchsia" icon="fab fa-hackerrank" title=" " %}}0.112.0{{% /badge %}} this only works for leaf bundles. Branch bundles and simple pages must be switched to leaf bundles or you are currently locked to a Hugo version < `0.112.0`.
12+
{{% /notice %}}
13+
1014
## Usage
1115

1216
While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials.
@@ -48,33 +52,35 @@ While the examples are using shortcodes with named parameter you are free to als
4852

4953
The shortcode lists files found in a specific folder. The name of the folder depends on your page type (either branch bundle, leaf bundle or page).
5054

51-
1. For simple pages, attachments must be placed in a folder named like your page and ending with `.files`.
55+
1. If your page is a leaf bundle, attachments must be placed in a nested `index.files` folder, accordingly.
5256

5357
> * content
5458
> * _index.md
55-
> * **page.files**
56-
> * attachment.pdf
57-
> * page.md
59+
> * page
60+
> * _index.md
61+
> * **_index.files**
62+
> * attachment.pdf
5863
59-
2. If your page is a branch or leaf bundle, attachments must be placed in a nested `_index.files` or `index.files` folder, accordingly.
64+
2. If your page is a branch bundle, attachments must be placed in a nested `_index.files` folder, accordingly.
6065

61-
For branch bundles:
66+
{{% badge style="warning" title=" " %}}Warning{{% /badge %}} This is only available for Hugo < `0.112.0`
6267

6368
> * content
6469
> * _index.md
6570
> * page
66-
> * index.md
67-
> * **index.files**
68-
> * attachment.pdf
71+
> * index.md
72+
> * **index.files**
73+
> * attachment.pdf
6974
70-
For leaf bundles:
75+
3. For simple pages, attachments must be placed in a folder named like your page and ending with `.files`.
76+
77+
{{% badge style="warning" title=" " %}}Warning{{% /badge %}} This is only available for Hugo < `0.112.0`
7178

7279
> * content
7380
> * _index.md
74-
> * page
75-
> * _index.md
76-
> * **_index.files**
77-
> * attachment.pdf
81+
> * **page.files**
82+
> * attachment.pdf
83+
> * page.md
7884
7985
### Multilingual
8086

@@ -83,14 +89,15 @@ Be aware that if you use a multilingual website, you will need to have as many f
8389
Eg. for a site in English and Piratish:
8490

8591
> * content
86-
> * _index.en.md
87-
> * _index.pir.md
88-
> * **page.en.files**
89-
> * attachment.pdf
90-
> * **page.pir.files**
91-
> * attachment.pdf
92-
> * page.en.md
93-
> * page.pir.md
92+
> * index.en.md
93+
> * index.pir.md
94+
> * page
95+
> * index.en.md
96+
> * index.pir.md
97+
> * **index.en.files**
98+
> * attachment.pdf
99+
> * **index.pir.files**
100+
> * attachment.pdf
94101
95102
## Examples
96103

File renamed without changes.

0 commit comments

Comments
 (0)