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