Age | Commit message (Collapse) | Author | |
---|---|---|---|
2018-01-22 | resource: Avoid some strings.ToLower in globbing | Bjørn Erik Pedersen | |
See #4301 | |||
2018-01-22 | resource: Add Match and GetMatch | Bjørn Erik Pedersen | |
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-17 | resource: Use path.Match instead of filepath.Match | Bjørn Erik Pedersen | |
They behave similar, but it is a path we're matching. See #4244 | |||
2018-01-17 | resource: Add front matter metadata to Resource | Bjørn Erik Pedersen | |
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 | |||
2018-01-15 | resource: Fix handling of very long image file names | Bjørn Erik Pedersen | |
Fixes #4261 | |||
2018-01-13 | resource: Add some GoDoc | Bjørn Erik Pedersen | |
2018-01-12 | resource: Implement Resources.ByPrefix | Bjørn Erik Pedersen | |
Fixes #4266 | |||
2018-01-12 | resource: Make GetByPrefix work for Page resources | Bjørn Erik Pedersen | |
Fixes #4264 | |||
2018-01-11 | resource: Make .Resources.GetByPrefix case insensitive | Bjørn Erik Pedersen | |
Fixes #4258 | |||
2018-01-11 | resource: Remove superflous comment | Bjørn Erik Pedersen | |
2018-01-10 | Fix non-ASCII path handling for Page resources | Bjørn Erik Pedersen | |
Fixes #4241 | |||
2018-01-07 | resource: Avoid processing and storing same image for each language | Bjørn Erik Pedersen | |
Fixes #4231 | |||
2018-01-07 | resource: Resources.ByType should return Resources | Bjørn Erik Pedersen | |
Currently it returns []Resource. This way the invocations can be nested. Fixes #4234 | |||
2018-01-06 | Fix URLs for bundle resources in multihost mode | Bjørn Erik Pedersen | |
Fixes #4217 | |||
2018-01-06 | Fix sub-folder baseURL handling for Page resources | Bjørn Erik Pedersen | |
I.e. images etc. Fixes #4228 | |||
2018-01-03 | resource: Handle publish to /public on fresh build | Bjørn Erik Pedersen | |
Fixes #4213 | |||
2018-01-01 | resource: Use the correct Destination FS | Bjørn Erik Pedersen | |
Source and destination will be the same when this happens, but it should be correct. See #4202 | |||
2018-01-01 | resource: Create target dir if not exists | Bjørn Erik Pedersen | |
This is the case where image processing is triggered from shortcodes, i.e. before the target page's folder in /public is created. Fixes #4202 | |||
2017-12-28 | resource: Avoid potential case issue in image names | Bjørn Erik Pedersen | |
2017-12-28 | helpers: Avoid writing the last MD5 buff part twice | Bjørn Erik Pedersen | |
2017-12-28 | resource: Use MD5 to identify image files | Bjørn Erik Pedersen | |
But only a set of byte chunks spread around in the image file to calculate the fingerprint, which is much faster than reading the whole file: ```bash BenchmarkMD5FromFileFast/full=false-4 300000 4356 ns/op 240 B/op 5 allocs/op BenchmarkMD5FromFileFast/full=true-4 30000 42899 ns/op 32944 B/op 5 allocs/op ``` Fixes #4186 | |||
2017-12-27 | :sparkles: Implement Page bundling and image handling | Bjørn Erik Pedersen | |
This commit is not the smallest in Hugo's history. Some hightlights include: * Page bundles (for complete articles, keeping images and content together etc.). * Bundled images can be processed in as many versions/sizes as you need with the three methods `Resize`, `Fill` and `Fit`. * Processed images are cached inside `resources/_gen/images` (default) in your project. * Symbolic links (both files and dirs) are now allowed anywhere inside /content * A new table based build summary * The "Total in nn ms" now reports the total including the handling of the files inside /static. So if it now reports more than you're used to, it is just **more real** and probably faster than before (see below). A site building benchmark run compared to `v0.31.1` shows that this should be slightly faster and use less memory: ```bash ▶ ./benchSite.sh "TOML,num_langs=.*,num_root_sections=5,num_pages=(500|1000),tags_per_page=5,shortcodes,render" benchmark old ns/op new ns/op delta BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 101785785 78067944 -23.30% BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 185481057 149159919 -19.58% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 103149918 85679409 -16.94% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 203515478 169208775 -16.86% benchmark old allocs new allocs delta BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 532464 391539 -26.47% BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 1056549 772702 -26.87% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 555974 406630 -26.86% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 1086545 789922 -27.30% benchmark old bytes new bytes delta BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 53243246 43598155 -18.12% BenchmarkSiteBuilding/TOML,num_langs=1,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 105811617 86087116 -18.64% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=500,tags_per_page=5,shortcodes,render-4 54558852 44545097 -18.35% BenchmarkSiteBuilding/TOML,num_langs=3,num_root_sections=5,num_pages=1000,tags_per_page=5,shortcodes,render-4 106903858 86978413 -18.64% ``` Fixes #3651 Closes #3158 Fixes #1014 Closes #2021 Fixes #1240 Updates #3757 |