-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .Resources.ByMatch and GetByMatch #4301
Labels
Milestone
Comments
We should also add GetByMatch fro completeness. |
I will add those to a patch release ... But I will probably wait to see if more bugs "happens" until I go that route. The implementation should be trivial. |
bep
changed the title
Add .Resources.ByMatch (or something)
Add .Resources.ByMatch and GetByMatch
Jan 19, 2018
bep
added a commit
to bep/hugo
that referenced
this issue
Jan 20, 2018
A simple benchmarks comparing it to the *Prefix variant doing the same: ```bash BenchmarkResourcesByPrefix-4 200000 6903 ns/op 505 B/op 3 allocs/op BenchmarkResourcesByMatch-4 200000 8841 ns/op 505 B/op 3 allocs/op ``` Fixes gohugoio#4301
bep
added a commit
to bep/hugo
that referenced
this issue
Jan 21, 2018
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 Fixes gohugoio#4301
bep
added a commit
to bep/hugo
that referenced
this issue
Jan 21, 2018
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`. Fixes gohugoio#4301
bep
added a commit
to bep/hugo
that referenced
this issue
Jan 21, 2018
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 gohugoio#4301
bep
added a commit
to bep/hugo
that referenced
this issue
Jan 22, 2018
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 gohugoio#4301
bep
added a commit
that referenced
this issue
Jan 22, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add to Resources a method for retrieving resources using a matching pattern (images/*.jpg)
Uses the same value to match against as the existing ByPrefix
The text was updated successfully, but these errors were encountered: