summaryrefslogtreecommitdiffstats
path: root/cache
Commit message (Collapse)AuthorAge
* Revise the use of htime.Since/htime.NowBjørn Erik Pedersen2022-05-09
| | | | | | | | | 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
* Add `clock` cli flagsatotake2022-05-08
| | | | Close #8787
* Improve error messages, esp. when the server is runningBjørn Erik Pedersen2022-05-06
| | | | | | | | | | | | * 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
* Rework the Destination filesystem to make --renderStaticToDisk workBjørn Erik Pedersen2022-04-08
| | | | See #9626
* all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen2022-03-17
| | | | Updates #9687
* Remove the retries on error in remote resources.GetBjørn Erik Pedersen2021-12-10
| | | | | Fixes #9271 See #9259
* resources: Add timeout to the HTTP request in GetBjørn Erik Pedersen2021-12-02
| | | | Workaround for https://github.com/golang/go/issues/49366
* Add a remote retry for resources.GetBjørn Erik Pedersen2021-12-02
|
* Make resources.Get use a file cache for remote resourcesPaul van Brouwershaven2021-12-02
| | | Closes #9228
* Misc config loading fixesBjørn Erik Pedersen2021-06-14
| | | | | | | | | | | | | | | | 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
* all: Fix minor typosPhil Davis2020-12-16
|
* all: Format code with gofumptBjørn Erik Pedersen2020-12-03
| | | | See https://github.com/mvdan/gofumpt
* modules: Add noVendor to module configBjørn Erik Pedersen2020-09-10
| | | | Fixes #7647
* cache: Remove some unused codeBjørn Erik Pedersen2020-06-25
|
* commands: Add "hugo mod verify"Bjørn Erik Pedersen2020-02-19
| | | | See #6907
* resources/images: Make the image cache more robustBjørn Erik Pedersen2019-11-25
| | | | | | Also allow timeout to be set as a duration string, e.g. `30s`. Fixes #6501
* cache/filecache: Recover from file corruptionBjørn Erik Pedersen2019-10-21
| | | | Fixes #6401
* filecache: Ignore "does not exist" errors in pruneBjørn Erik Pedersen2019-09-12
| | | | | Fixes #6326 Fixes #5745
* tests: Convert from testify to quicktestBjørn Erik Pedersen2019-08-12
|
* Fix Jekyll importBjørn Erik Pedersen2019-07-30
| | | | Fixes #6131
* Revert "cache/filecache: Skip resource cache init if the fs is missing"Bjørn Erik Pedersen2019-07-26
| | | | | | I need to revisit this. This reverts commit da4c4a7789d403af3f4f4fdd5dfd3327535e4050.
* cache/filecache: Skip resource cache init if the fs is missingBjørn Erik Pedersen2019-07-26
| | | | Fixes #6113
* Block symlink dir traversal for /staticBjørn Erik Pedersen2019-07-25
| | | | | 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.
* Add Hugo ModulesBjørn Erik Pedersen2019-07-24
| | | | | | | | | | | | | | | | | | | | | | | 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
* all: Apply staticcheck recommendationsBjørn Erik Pedersen2019-03-24
|
* Run gofmt -sBjørn Erik Pedersen2019-03-23
|
* cache/namedmemcache: Fix data raceBjørn Erik Pedersen2018-12-27
|
* tpl/transform: Add transform.Unmarshal funcBjørn Erik Pedersen2018-12-23
| | | | Fixes #5428
* cache/filecache: Simplify testBjørn Erik Pedersen2018-12-04
| | | | See #5497
* cache/filecache: Use OS fs for testBjørn Erik Pedersen2018-12-04
| | | | See #5497
* Remove duplicate mapstructure depdendencyBjørn Erik Pedersen2018-11-28
|
* Handle themes in the new file cache (for images, assets)Bjørn Erik Pedersen2018-11-23
| | | | | | 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
* cache/filecache: Add a :project placeholderBjørn Erik Pedersen2018-11-14
| | | | | | 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
* cache/filecache: Add a cache prune funcBjørn Erik Pedersen2018-11-14
| | | | Fixes #5439
* cache/filecache: Add a filecache root dirBjørn Erik Pedersen2018-11-14
| | | | This is just a safe guard to make sure we don't evict/remove files that do not belong to the cache.
* cache/filecache: Use time.Duration for maxAgeBjørn Erik Pedersen2018-11-14
| | | | Fixes #5438
* cache/filecache: Split implementation and config into separate filesBjørn Erik Pedersen2018-11-14
|
* More spelling correctionsBjørn Erik Pedersen2018-11-13
|
* cache/filecache: Spelling correctionsBjørn Erik Pedersen2018-11-13
|
* Add a consolidated file cacheBjørn Erik Pedersen2018-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Simplify .Site.GetPage etc.Bjørn Erik Pedersen2018-07-18
| | | | | | | | | | | | | | | | | | | | | | 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
* cache: Add even more concurrency to testBjørn Erik Pedersen2017-06-28
|
* cache: Add concurrent cache testBjørn Erik Pedersen2017-06-28
|
* cache: Add a simple partitioned lazy cacheBjørn Erik Pedersen2017-05-26