hugo/resource
Bjørn Erik Pedersen 9421380168
resource: Add Match and GetMatch
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
2018-01-22 10:28:12 +01:00
..
testdata resource: Fix handling of very long image file names 2018-01-15 20:22:14 +01:00
image.go resource: Add front matter metadata to Resource 2018-01-17 16:22:33 +01:00
image_cache.go resource: Add front matter metadata to Resource 2018-01-17 16:22:33 +01:00
image_test.go resource: Add front matter metadata to Resource 2018-01-17 16:22:33 +01:00
resource.go resource: Add Match and GetMatch 2018-01-22 10:28:12 +01:00
resource_test.go resource: Add Match and GetMatch 2018-01-22 10:28:12 +01:00
testhelpers_test.go resource: Fix handling of very long image file names 2018-01-15 20:22:14 +01:00