aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources
AgeCommit message (Collapse)Author
2024-08-25Fix missing method NameNormalized panicBjørn Erik Pedersen
Closes #12795
2024-08-17Add config options page.nextPrevSortOrder/nextPrevInSectionSortOrderBjørn Erik Pedersen
See #12776
2024-08-14resources: Add URI GetRemote errorb10c
Previouly, only "ERROR failed to fetch remote resource: Forbidden" would be shown when a resource failed to load. In my case, a tweet's author I was embedding using the twitter shortcode switched his profile to private which resulted in my blog failing to build. To figure out where the originates, I added the log to the error message.
2024-08-10Fix compare of uints and ints in eq, gt etc.Bjørn Erik Pedersen
Fixes #12733
2024-08-02Fix images.AutoOrient regressionBjørn Erik Pedersen
Broken in v0.130.0. Added a integration test to avoid future breakage. Fixes #12712
2024-08-02revamp pagegroup tests with quicktestn1xx1
2024-08-02allow nested params when using Pages.GroupByParam and Pages.GroupByParamDaten1xx1
2024-08-01resources/page: Expand parmalinks tokens in `url`n1xx1
This change allows to use permalink tokens in url front matter fields. This should be useful to target more specific pages instead of using a global permalink configuration. It's expected to be used with cascade. Fixes #9714
2024-07-31Shorten processed image filenamesBjørn Erik Pedersen
Fixes #12688 Fixes #12656
2024-07-31Consolidate all hashing to the common/hashing packageBjørn Erik Pedersen
And remove now unsued hashing funcs.
2024-07-31Replace the MD5 hashing of images with xxHashBjørn Erik Pedersen
Note that we only use this for change detection. The previous implementation invoked `MD5FromReaderFast` that created a MD5 has from 8 64 bytes chunks in the file, which is obviously very fast. The new implementation creates the hash from the entire file and ... seems to be even more effective: ``` name old time/op new time/op delta HashImage-10 9.45µs ±21% 10.89µs ± 1% ~ (p=0.343 n=4+4) name old alloc/op new alloc/op delta HashImage-10 144B ± 0% 8B ± 0% -94.44% (p=0.029 n=4+4) name old allocs/op new allocs/op delta HashImage-10 4.00 ± 0% 1.00 ± 0% -75.00% (p=0.029 n=4+4) ```
2024-07-31resources: Add BenchmarkHashImageBjørn Erik Pedersen
2024-07-31identity: Use xxHash in hashstructure (note)Bjørn Erik Pedersen
``` name old time/op new time/op delta HashString/n28-10 133ns ± 9% 107ns ±10% -19.58% (p=0.029 n=4+4) HashString/n112-10 243ns ± 5% 121ns ± 4% -50.08% (p=0.029 n=4+4) HashString/n448-10 698ns ± 3% 174ns ± 5% -75.02% (p=0.029 n=4+4) HashString/n1792-10 2.58µs ± 4% 0.38µs ± 4% -85.11% (p=0.029 n=4+4) HashString/n7168-10 10.0µs ± 3% 1.3µs ± 4% -86.91% (p=0.029 n=4+4) name old alloc/op new alloc/op delta HashString/n28-10 80.0B ± 0% 72.0B ± 0% -10.00% (p=0.029 n=4+4) HashString/n112-10 160B ± 0% 152B ± 0% -5.00% (p=0.029 n=4+4) HashString/n448-10 496B ± 0% 488B ± 0% -1.61% (p=0.029 n=4+4) HashString/n1792-10 1.84kB ± 0% 1.83kB ± 0% -0.43% (p=0.029 n=4+4) HashString/n7168-10 8.24kB ± 0% 8.23kB ± 0% -0.06% (p=0.029 n=4+4) name old allocs/op new allocs/op delta HashString/n28-10 4.00 ± 0% 3.00 ± 0% -25.00% (p=0.029 n=4+4) HashString/n112-10 4.00 ± 0% 3.00 ± 0% -25.00% (p=0.029 n=4+4) HashString/n448-10 4.00 ± 0% 3.00 ± 0% -25.00% (p=0.029 n=4+4) HashString/n1792-10 4.00 ± 0% 3.00 ± 0% -25.00% (p=0.029 n=4+4) HashString/n7168-10 4.00 ± 0% 3.00 ± 0% -25.00% (p=0.029 n=4+4) ```
2024-07-31identity: Upgrade to github.com/mitchellh/hashstructure/v2 v2.0.2Bjørn Erik Pedersen
``` name old time/op new time/op delta HashString/n28-10 131ns ± 7% 133ns ±19% ~ (p=0.343 n=4+4) HashString/n112-10 237ns ± 5% 241ns ± 3% ~ (p=0.229 n=4+4) HashString/n448-10 688ns ± 3% 687ns ± 1% ~ (p=0.886 n=4+4) HashString/n1792-10 2.51µs ± 3% 2.56µs ± 3% ~ (p=0.200 n=4+4) HashString/n7168-10 10.1µs ± 2% 10.0µs ± 4% ~ (p=0.686 n=4+4) name old alloc/op new alloc/op delta HashString/n28-10 80.0B ± 0% 80.0B ± 0% ~ (all equal) HashString/n112-10 160B ± 0% 160B ± 0% ~ (all equal) HashString/n448-10 496B ± 0% 496B ± 0% ~ (all equal) HashString/n1792-10 1.84kB ± 0% 1.84kB ± 0% ~ (all equal) HashString/n7168-10 8.24kB ± 0% 8.24kB ± 0% ~ (all equal) name old allocs/op new allocs/op delta HashString/n28-10 4.00 ± 0% 4.00 ± 0% ~ (all equal) HashString/n112-10 4.00 ± 0% 4.00 ± 0% ~ (all equal) HashString/n448-10 4.00 ± 0% 4.00 ± 0% ~ (all equal) HashString/n1792-10 4.00 ± 0% 4.00 ± 0% ~ (all equal) HashString/n7168-10 4.00 ± 0% 4.00 ± 0% ~ (all equal) ``` Closes #11644
2024-07-20Switch EXIF libraryBjørn Erik Pedersen
Closes #10855 Closes #8586 Closes #8996
2024-07-01Fix it so publishDate rolls up to section, taxonomy, or term pagesBjørn Erik Pedersen
Fixes #12438
2024-06-25Add css.TailwindCSSBjørn Erik Pedersen
Closes #12618 Closes #12620
2024-06-23Implement deferBjørn Erik Pedersen
Closes #8086 Closes #12589
2024-06-13resources: Update Dart Sass error messageJoe Mooring
2024-06-09resources/page: Deprecate PageSize in favor of PagerSizeBjørn Erik Pedersen
See #12572
2024-06-09Rename DefaultPageSize => PagerSizeBjørn Erik Pedersen
This was recently introduced. so no breaking change. The thing is: * We do not commonly use the prefix Default* even if it can be overridden in the templates. * PagerSize makes more sense and is also the term used in the code.
2024-06-08resources/page: Let GroupByParam return nil instead of errorJoe Mooring
Closes #12578
2024-06-08Add option to not generate aliases for first page of pagination pagesBjørn Erik Pedersen
Also consolidate the pagination configuration into a struct. Closes #12572
2024-06-08js: Support more recent targets with js.Build / esbuildBjørn Erik Pedersen
Closes #12575
2024-06-04resources: Fix spellingBjørn Erik Pedersen
2024-06-04Add a HTTP cache for remote resources.Bjørn Erik Pedersen
Fixes #12502 Closes #11891
2024-06-01resources/page: Deprecate .Sites.First in favor of .Sites.DefaultJoe Mooring
Closes #12513
2024-05-30content adapter: Add support for menus in AddPageBjørn Erik Pedersen
Fixes #12507
2024-05-15Fix mixed case Page params handling in content adaptersBjørn Erik Pedersen
Fixes #12497
2024-05-15Fix paths with dots issue with content adaptersBjørn Erik Pedersen
Fixes #12493
2024-05-14resources/images: Handle NaN EXIF latitude and longitudeJoe Mooring
Fixes #12490
2024-05-14Create pages from _content.gotmplBjørn Erik Pedersen
Closes #12427 Closes #12485 Closes #6310 Closes #5074
2024-05-05Fix one more resource change eviction logic issueBjørn Erik Pedersen
This is how we should have fixed #1239. Fixes #12456
2024-05-04Make the cache eviction logic for stale entities more robustBjørn Erik Pedersen
Fixes #12458
2024-05-02Run mage generateBjørn Erik Pedersen
2024-05-02resources/page: Pull internal Page methods into its own interfaceBjørn Erik Pedersen
So it doesn't get visible when passing it to `jsonify`.
2024-04-20Fix partial rebuilds for SCSS fetched with GetMatch and similarBjørn Erik Pedersen
Fixes #12395
2024-04-19resources/images: Fix TestColorLuminance on s390xBjørn Erik Pedersen
2024-04-16Add Luminance to ColorBjørn Erik Pedersen
To sort an image's colors from darkest to lightest, you can then do: ```handlebars {{ {{ $colorsByLuminance := sort $image.Colors "Luminance" }} ``` This uses the formula defined here: https://www.w3.org/TR/WCAG21/#dfn-relative-luminance Fixes #10450
2024-04-15Pass .RenderShortcodes' Page to render hooks as .PageInnerBjørn Erik Pedersen
The main use case for this is to resolve links and resources (e.g. images) relative to the included `Page`. A typical `include` would similar to this: ```handlebars {{ with site.GetPage (.Get 0) }} {{ .RenderShortcodes }} {{ end }} ``` And when used in a Markdown file: ```markdown {{% include "/posts/p1" %}} ``` Any render hook triggered while rendering `/posts/p1` will get `/posts/p1` when calling `.PageInner`. Note that * This is only relevant for shortcodes included with `{{%` that calls `.RenderShortcodes`. * `.PageInner` is available in all render hooks that, before this commit, received `.Page`. * `.PageInner` will fall back to the value of `.Page` if not relevant and will always have a value. Fixes #12356
2024-04-12resources/page: Add taxonomies Page methodJoe Mooring
Closes #12316
2024-04-11all: Typo fixesChristian Oliff
2024-04-08babel: Run go fmtBjørn Erik Pedersen
2024-04-08babel: Close file before removingguangwu
2024-04-05resources/page: Escape hash sign in permalinksSoren L. Hansen
When creating a link to a file with a `#` in the filename, the link gets truncated. This happens because the filename is eventaully passed to `url.Parse` which (correctly!) interprets the `#` as fragment separator. This commit escapes the `#` in the filename before creating the link. Fixes #4926 Fixes #8232 Fixes #12342 Co-authored-by: Joe Mooring <[email protected]>
2024-03-27resources: Use different cache key when copying resourcesJoe Mooring
Closes #10412 Closes #12310
2024-03-22resources/page: Fix GoDoc commentGeorge Ma
2024-03-20testing: Set usesFMA as true for riscv64 tooAnthony Fok
This fixes TestImageOperationsGolden "values are not deep equal" error on riscv64 with Go 1.22 and above.
2024-03-15hugolib: Deprecate site methods Author, Authors, and SocialJoe Mooring
Closes #12228
2024-03-15all: Typo fixesChristian Oliff