diff options
author | vjeantet <valere.jeantet@gmail.com> | 2020-08-19 15:02:59 +0300 |
---|---|---|
committer | vjeantet <valere.jeantet@gmail.com> | 2020-08-19 15:02:59 +0300 |
commit | a86af279ec44943377320c8619a2ee3331927ca1 (patch) | |
tree | e370c51498e5dad24dca23aed1d136f92e7b9156 | |
parent | a5f3708cf8330fcd6653a18564dc77e156fc41cf (diff) |
fix attachements shortcode
-rw-r--r-- | exampleSite/content/shortcodes/attachments/_index.md | 31 | ||||
-rw-r--r-- | layouts/shortcodes/attachments.html | 4 |
2 files changed, 14 insertions, 21 deletions
diff --git a/exampleSite/content/shortcodes/attachments/_index.md b/exampleSite/content/shortcodes/attachments/_index.md index 41f3337..c465e75 100644 --- a/exampleSite/content/shortcodes/attachments/_index.md +++ b/exampleSite/content/shortcodes/attachments/_index.md @@ -12,25 +12,18 @@ Example : ## Usage -The shortcurt lists files found in a **specific folder**. -Currently, it support two implementations for pages - -1. If your page is a markdown file, attachements must be place in a **folder** named like your page and ending with **.files**. - - > * content - > * _index.md - > * page.files - > * attachment.pdf - > * page.md - -2. If your page is a **folder**, attachements must be place in a nested **'files'** folder. - - > * content - > * _index.md - > * page - > * index.md - > * files - > * attachment.pdf +The shortcurt lists files found in the **_files folder**. + +2. If your page is a **folderA**, attachements must be place in a **'_files'** subfolder. + +``` +content +└── folderA + ├── _index.md + └── _files + ├── attachment.pdf + └── attachment.pdf +``` That's all ! diff --git a/layouts/shortcodes/attachments.html b/layouts/shortcodes/attachments.html index c4de3b8..c6eb8c2 100644 --- a/layouts/shortcodes/attachments.html +++ b/layouts/shortcodes/attachments.html @@ -8,8 +8,8 @@ </label> {{with .Page.File}} -{{if eq .BaseFileName "index"}} - {{$.Scratch.Add "filesName" "files"}} +{{if eq .BaseFileName "_index"}} + {{$.Scratch.Add "filesName" "_files"}} {{else}} {{$.Scratch.Add "filesName" (printf "%s.files" .BaseFileName)}} {{end}} |