Given a bundle in `blog/my-bundle/index.en.md` all of these will now worK:
* `blog/my-bundle/index.en.md`
* `blog/my-bundle/index`
* `blog/my-bundle`
* `my-bundle`
The last one is potentially ambigous.
Fixes#4312
This commit adds support for `headless bundles` for the `index` bundle type.
So:
```toml
headless = true
```
In front matter means that
* It will have no `Permalink` and no rendered HTML in /public
* It will not be part of `.Site.RegularPages` etc.
But you can get it by:
* `.Site.GetPage ...`
The use cases are many:
* Shared media galleries
* Reusable page content "snippets"
* ...
Fixes#4311
This allows setting default params values in the more general resource matchers. I also allows override with more specific values if needed.
```toml
[[resources]]
src = "documents/photo_specs.pdf"
title = "Photo Specifications"
[resources.params]
ref = 90564687
icon = "photo"
[[resources]]
src = "documents/guide.pdf"
title = "Instruction Guide"
[resources.params]
ref = 90564568
[[resources]]
src = "documents/checklist.pdf"
title = "Document Checklist"
[resources.params]
ref = 90564572
[[resources]]
src = "documents/payment.docx"
title = "Proof of Payment"
[[resources]]
src = "documents/*.pdf"
title = "PDF file"
[resources.params]
icon = "pdf"
[[resources]]
src = "documents/*.docx"
title = "Word document"
[resources.params]
icon = "word"
```
In the above `TOML` example, `photo_specs.pdf` will get the `photo` icon, the other pdf files will get the default `pdf` icon.
Note that in the example above, the order matters: It will take the first value for a given params key, title or name that it finds.
Fixes#4315
These methods takes a glob pattern as argument:
* by default matching from the bundle root
* matching is case insensitive and the separator is Unix style slashes: "/"
* the bundle root does (by default) not start with a leading slash
* if you renames the `Name` for the rsource in front matter (`src=...`), then that is the value used in `Match`.
* double asterisk matches beyond directory borders, so "**.jpg" will match any JPEG image in the bundle
See https://github.com/gobwas/glob
This commit also deprecates `ByPrefix` and `GetByPrefix`.
This should also be more effective, given a fair amount of reuse of the glob patterns:
```bash
BenchmarkResourcesByPrefix-4 300000 4284 ns/op 1130 B/op 7 allocs/op
BenchmarkResourcesMatch-4 300000 5220 ns/op 505 B/op 3 allocs/op
```
Fixes#4301
56c34962c Fix multilingual config examples
14fa0b4ed Release 0.32.4
18779d54a releaser: Add release notes to /docs for release of 0.32.4
0d47d0673 releaser: Bump versions for release of 0.32.4
424acf02e Release 0.32.3
f6f04e084 releaser: Prepare repository for 0.33-DEV
1a9b36286 releaser: Add release notes to /docs for release of 0.32.3
9284c3284 releaser: Bump versions for release of 0.32.3
796082289 Fix min Go version in installing
74625a654 Add alias to multilingual.md
bf65732b4 Add some new tweets to the front page
7f263353e Bump Netlify to 0.32.2
cbb3a4f1c Update 0.32.2 release notes
e90ae4b4e releaser: Prepare repository for 0.33-DEV
ee74a8f4f releaser: Add release notes to /docs for release of 0.32.2
d889c4fa4 releaser: Bump versions for release of 0.32.2
4a46d3aca Merge commit 'eb738cd35cca1ffc68c5ed688dbe2a19108e8761'
b98d95ff2 releaser: Prepare repository for 0.33-DEV
git-subtree-dir: docs
git-subtree-split: 56c34962c92706792231fd5056d33186b11c4e33
You can still use the full path with extensions, but to get the current language version:
* If the content file lives in `/content/blog/mypost.en.md`
* Use `.Site.GetPage "page" "blog/mypost"`
Fixes#4285
This commit expands the Resource interface with 3 new methods:
* Name
* Title
* Params
All of these can be set in the Page front matter. `Name` will get its default value from the base filename, and is the value used in the ByPrefix and GetByPrefix lookup methods.
Fixes#4244
This commit also has some other nice side-effects:
* The layout logic is unified for all page types, which should make it less surprising
* Page.Render now supports all types
* The legacy "indexes" type is removed from the template lookup order. This is an undocumented type from early Hugo days. This means that having a template in, say, `/layouts/indexes/list.html` will no longer work.
* The theme override logic is improved. As an example, an `index.html` in theme will now wn over a `_default/list.html` in the project, which most will expect.
Fixes#3005Fixes#3245