Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cache
AgeCommit message (Collapse)Author
2022-05-09Revise the use of htime.Since/htime.NowBjørn Erik Pedersen
We cannot (also, it doesn't add any value) use that when the `clock` is set, * To measure time (before that global is set) * To compare file timestamps re cache eviction Fixes #9868
2022-05-08Add `clock` cli flagsatotake
Close #8787
2022-05-06Improve error messages, esp. when the server is runningBjørn Erik Pedersen
* Add file context to minifier errors when publishing * Misc fixes (see issues) * Allow custom server error template in layouts/server/error.html To get to this, this commit also cleans up and simplifies the code surrounding errors and files. This also removes the usage of `github.com/pkg/errors`, mostly because of https://github.com/pkg/errors/issues/223 -- but also because most of this is now built-in to Go. Fixes #9852 Fixes #9857 Fixes #9863
2022-04-08Rework the Destination filesystem to make --renderStaticToDisk workBjørn Erik Pedersen
See #9626
2022-03-18all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2021-12-10Remove the retries on error in remote resources.GetBjørn Erik Pedersen
Fixes #9271 See #9259
2021-12-02resources: Add timeout to the HTTP request in GetBjørn Erik Pedersen
Workaround for https://github.com/golang/go/issues/49366
2021-12-02Add a remote retry for resources.GetBjørn Erik Pedersen
2021-12-02Make resources.Get use a file cache for remote resourcesPaul van Brouwershaven
Closes #9228
2021-06-14Misc config loading fixesBjørn Erik Pedersen
The main motivation behind this is simplicity and correctnes, but the new small config library is also faster: ``` BenchmarkDefaultConfigProvider/Viper-16 252418 4546 ns/op 2720 B/op 30 allocs/op BenchmarkDefaultConfigProvider/Custom-16 450756 2651 ns/op 1008 B/op 6 allocs/op ``` Fixes #8633 Fixes #8618 Fixes #8630 Updates #8591 Closes #6680 Closes #5192
2020-12-16all: Fix minor typosPhil Davis
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-09-10modules: Add noVendor to module configBjørn Erik Pedersen
Fixes #7647
2020-06-25cache: Remove some unused codeBjørn Erik Pedersen
2020-02-19commands: Add "hugo mod verify"Bjørn Erik Pedersen
See #6907
2019-11-25resources/images: Make the image cache more robustBjørn Erik Pedersen
Also allow timeout to be set as a duration string, e.g. `30s`. Fixes #6501
2019-10-21cache/filecache: Recover from file corruptionBjørn Erik Pedersen
Fixes #6401
2019-09-12filecache: Ignore "does not exist" errors in pruneBjørn Erik Pedersen
Fixes #6326 Fixes #5745
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
2019-07-30Fix Jekyll importBjørn Erik Pedersen
Fixes #6131
2019-07-26Revert "cache/filecache: Skip resource cache init if the fs is missing"Bjørn Erik Pedersen
I need to revisit this. This reverts commit da4c4a7789d403af3f4f4fdd5dfd3327535e4050.
2019-07-26cache/filecache: Skip resource cache init if the fs is missingBjørn Erik Pedersen
Fixes #6113
2019-07-25Block symlink dir traversal for /staticBjørn Erik Pedersen
This is in line with how it behaved before, but it was lifted a little for the project mount for Hugo Modules, but that could create hard-to-detect loops.
2019-07-24Add Hugo ModulesBjørn Erik Pedersen
This commit implements Hugo Modules. This is a broad subject, but some keywords include: * A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project. * A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects. * Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running. * Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions. * A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`. All of the above is backed by Go Modules. Fixes #5973 Fixes #5996 Fixes #6010 Fixes #5911 Fixes #5940 Fixes #6074 Fixes #6082 Fixes #6092
2019-03-24all: Apply staticcheck recommendationsBjørn Erik Pedersen
2019-03-23Run gofmt -sBjørn Erik Pedersen
2018-12-27cache/namedmemcache: Fix data raceBjørn Erik Pedersen
2018-12-23tpl/transform: Add transform.Unmarshal funcBjørn Erik Pedersen
Fixes #5428
2018-12-04cache/filecache: Simplify testBjørn Erik Pedersen
See #5497
2018-12-04cache/filecache: Use OS fs for testBjørn Erik Pedersen
See #5497
2018-11-28Remove duplicate mapstructure depdendencyBjørn Erik Pedersen
2018-11-23Handle themes in the new file cache (for images, assets)Bjørn Erik Pedersen
In the newly consolidated file cache implementation, we forgot that we also look in the theme(s) for assets (SCSS transformations etc.), which is not good for Netlify and the demo sites. Fixes #5460
2018-11-15cache/filecache: Add a :project placeholderBjørn Erik Pedersen
This allows for "cache per Hugo project", making `hugo --gc` work as expected, even if you have several Hugo projects running on the same PC. See #5439
2018-11-15cache/filecache: Add a cache prune funcBjørn Erik Pedersen
Fixes #5439
2018-11-15cache/filecache: Add a filecache root dirBjørn Erik Pedersen
This is just a safe guard to make sure we don't evict/remove files that do not belong to the cache.
2018-11-15cache/filecache: Use time.Duration for maxAgeBjørn Erik Pedersen
Fixes #5438
2018-11-15cache/filecache: Split implementation and config into separate filesBjørn Erik Pedersen
2018-11-13More spelling correctionsBjørn Erik Pedersen
2018-11-13cache/filecache: Spelling correctionsBjørn Erik Pedersen
2018-11-13Add a consolidated file cacheBjørn Erik Pedersen
This commits reworks how file caching is performed in Hugo. Now there is only one way, and it can be configured. This is the default configuration: ```toml [caches] [caches.getjson] dir = ":cacheDir" maxAge = -1 [caches.getcsv] dir = ":cacheDir" maxAge = -1 [caches.images] dir = ":resourceDir/_gen" maxAge = -1 [caches.assets] dir = ":resourceDir/_gen" maxAge = -1 ``` You can override any of these cache setting in your own `config.toml`. The placeholders explained: `:cacheDir`: This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others. `:resourceDir`: This is the value of the `resourceDir` config option. `maxAge` is the time in seconds before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml Fixes #5404
2018-07-18Simplify .Site.GetPage etc.Bjørn Erik Pedersen
This commit is a follow up to a recent overhaul of the GetPage/ref/relref implemenation. The most important change in this commit is the update to `.Site.GetPage`: * To reduce the amount of breakage in the wild to its minimum, I have reworked .Site.GetPage with some rules: * We cannot support more than 2 arguments, i.e. .Site.GetPage "page" "posts" "mypage.md" will now throw an error. I think this is the most uncommon syntax and should be OK. It is an easy fix to change the above to .Site.GetPage "/posts/mypage.md" or similar. * .Site.GetPage "home", .Site.GetPage "home" "" and .Site.GetPage "home" "/" will give you the home page. This means that if you have page in root with the name home.md you need to do .Site.GetPage "/home.md" or similar This commit also fixes some multilingual issues, most notable it is now possible to do cross-language ref/relref lookups by prepending the language code to the path, e.g. `/jp/posts/mypage.md`. This commit also reverts the site building tests related to this to "Hugo 0.44 state", to get better control of the changes made. Closes #4147 Closes #4727 Closes #4728 Closes #4728 Closes #4726 Closes #4652
2017-06-28cache: Add even more concurrency to testBjørn Erik Pedersen
2017-06-28cache: Add concurrent cache testBjørn Erik Pedersen
2017-05-26cache: Add a simple partitioned lazy cacheBjørn Erik Pedersen