summaryrefslogtreecommitdiffstats
path: root/hugofs
AgeCommit message (Collapse)Author
2023-06-29Misc permalinks adjustmentsBjørn Erik Pedersen
* Move config loading to the page package * Fix a lower bound panic for the `:sections` slice syntax. * Always return the `:title` * Add some permalinks integration tests * Also see issues below Fixes #9448 Fixes #11184 See #8523
2023-06-26resources/page: Allow section and taxonomy pages to have a permalink ↵Mai-Lapyst
configuration Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes #8523
2023-06-19all: Fix typos in function names and commentsOleksandr Redko
2023-06-18Replace the old log setup, with structured logging etc.Bjørn Erik Pedersen
Fixes #11124
2023-05-28Don't create the public folder unless neededBjørn Erik Pedersen
Fixes #11031
2023-05-22Add cache busting config to support Tailwind 3Bjørn Erik Pedersen
Fixes #10974
2023-05-19Fix some spelling mistakescui fliter
2023-05-18all: Fix comments for exported functions and packagesOleksandr Redko
2023-05-16Create a struct with all of Hugo's config optionsBjørn Erik Pedersen
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
2023-03-02Correct typos in Go commentsOleksandr Redko
2023-03-01Replace deprecated ioutil with io and osOleksandr Redko
https://pkg.go.dev/io/ioutil is deprecated since Go 1.16.
2023-01-04Misc doc, code refactoring to improve documentationBjørn Erik Pedersen
2022-12-14Also consider wrapped errors when checking for file IsNotExist errorsBjørn Erik Pedersen
Fixes #10534
2022-09-26Fix /static performance regression from Hugo 0.103.0Bjørn Erik Pedersen
In `v0.103.0` we added support for `resources.PostProcess` for all file types, not just HTML. We had benchmarks that said we were fine in that department, but those did not consider the static file syncing. This fixes that by: * Making sure that the /static syncer always gets its own file system without any checks for the post process token. * For dynamic files (e.g. rendered HTML files) we add an additional check to make sure that we skip binary files (e.g. images) Fixes #10328
2022-09-23Consolidate the glob case logicBjørn Erik Pedersen
Looking at the code as a whole, we ended up with a little to much "buttons". It turns out that doing case insensitive matching (lower both pattern and strings to match) performs just fine. Or at least, it gives the penalty to the people who uses mixed case filenames. ``` GetGlob/Default_cache-10 10.6ns ± 2% 10.6ns ± 1% ~ (p=0.657 n=4+4) GetGlob/Filenames_cache,_lowercase_searchs-10 10.6ns ± 2% 10.6ns ± 0% ~ (p=1.000 n=4+4) GetGlob/Filenames_cache,_mixed_case_searchs-10 29.7ns ± 1% 29.6ns ± 1% ~ (p=0.886 n=4+4) GetGlob/GetGlob-10 13.7ns ± 1% 13.7ns ± 0% ~ (p=0.429 n=4+4) name old alloc/op new alloc/op delta GetGlob/Default_cache-10 0.00B 0.00B ~ (all equal) GetGlob/Filenames_cache,_lowercase_searchs-10 0.00B 0.00B ~ (all equal) GetGlob/Filenames_cache,_mixed_case_searchs-10 5.00B ± 0% 5.00B ± 0% ~ (all equal) GetGlob/GetGlob-10 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta GetGlob/Default_cache-10 0.00 0.00 ~ (all equal) GetGlob/Filenames_cache,_lowercase_searchs-10 0.00 0.00 ~ (all equal) GetGlob/Filenames_cache,_mixed_case_searchs-10 1.00 ± 0% 1.00 ± 0% ~ (all equal) GetGlob/GetGlob-10 ```
2022-09-23hugofs: Fix glob case-sensitivity bugsatotake
On Linux, `hugofs.Glob` does not hit any directories which includes uppercase letters. (This does not happen on macOS.) Since `resources.GetMatch/Match` uses `Glob`, ``` {{ resources.GetMatch "Foo/bar.css" }} ``` this does not match `assets/Foo/bar.css` . On the other hand, you can get it with ``` {{ resources.Get "Foo/bar.css" }} ```
2022-09-14Support PostProcess for all file typesBjørn Erik Pedersen
Not just HTML. Fixes #10269
2022-05-15postcss: Fix import error handlingBjørn Erik Pedersen
Note that we will now fail if `inlineImports` is enabled and we cannot resolve an import. You can work around this by either: * Use url imports or imports with media queries. * Set `skipInlineImportsNotFound=true` in the options Also get the argument order in the different NewFileError* funcs in line. Fixes #9895
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-18Revert "Revert "Fix PostProcess regression for hugo server""Bjørn Erik Pedersen
This reverts commit 6c35a1a9eacf2aa86a11ecd31c4022ce330b2f16. Updates #9794
2022-04-17Revert "Fix PostProcess regression for hugo server"Bjørn Erik Pedersen
This reverts commit 4deb5c60661bdb1d686664f0207f45517a086f29.
2022-04-16Fix PostProcess regression for hugo serverBjørn Erik Pedersen
Fixes #9788
2022-04-10Replace all usage of CopyOnWriteFs with OverlayFsBjørn Erik Pedersen
Fixes #9761
2022-04-08Rework the Destination filesystem to make --renderStaticToDisk workBjørn Erik Pedersen
See #9626
2022-04-08Revert "Revert "Allow rendering static files to disk and dynamic to memory ↵Bjørn Erik Pedersen
in server mode"" This reverts commit 64b7b7a89753a39661219b2fcb92d7f185a03f63.
2022-03-20Make sure file mounts higher up winsBjørn Erik Pedersen
Fixes #9693
2022-03-17all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2022-03-11Revert "Allow rendering static files to disk and dynamic to memory in server ↵Bjørn Erik Pedersen
mode" This reverts commit 7d8011ed63d587b87a7c182748914fe146590093. Updates #9647
2022-03-08Allow rendering static files to disk and dynamic to memory in server modeSatowTakeshi
Updates #9625
2022-03-04tpl/os: Revert readDir in theme behaviourBjørn Erik Pedersen
Fixes #9599
2022-01-26Fix duplicate mount sourcesBjørn Erik Pedersen
Fixes #9426
2022-01-04Misc depreation updatesBjørn Erik Pedersen
* Deprecate .Page.Path when backed by a file * site.Permalinks * --ignoreVendor (use --ignoreVendorPaths) Closes #9348 Closes #9349
2021-11-16Fix content dir resolution when main project is a Hugo ModuleBjørn Erik Pedersen
Fixes #9177
2021-10-20hugofs: Add includeFiles and excludeFiles to mount configurationBjørn Erik Pedersen
Fixes #9042
2021-10-18Fix the "page picker" logic in --navigateToChangedBjørn Erik Pedersen
Fixes #9051
2021-10-16Reimplement archetypesBjørn Erik Pedersen
The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language: ```bash hugo new content/en/posts/my-first-post.md ``` Fixes #9032 Fixes #7589 Fixes #9043 Fixes #9046 Fixes #9047
2021-07-15hugofs: Make FileMeta a structBjørn Erik Pedersen
This commit started out investigating a `concurrent map read write` issue, ending by replacing the map with a struct. This is easier to reason about, and it's more effective: ``` name old time/op new time/op delta SiteNew/Regular_Deep_content_tree-16 71.5ms ± 3% 69.4ms ± 5% ~ (p=0.200 n=4+4) name old alloc/op new alloc/op delta SiteNew/Regular_Deep_content_tree-16 29.7MB ± 0% 27.9MB ± 0% -5.82% (p=0.029 n=4+4) name old allocs/op new allocs/op delta SiteNew/Regular_Deep_content_tree-16 313k ± 0% 303k ± 0% -3.35% (p=0.029 n=4+4) ``` See #8749
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
2021-06-05hugofs: Set modTime at creation timeBjørn Erik Pedersen
As `ModTime()` should return the same value on each invocation. See #6161
2021-06-04Fix invalid timestamp of the "public" folderAnthony Fok
Special thanks to both Richard Mortimer (@oldelvet) and Joshua M. Clulow (@jclulow) for their analysis and suggested fix: * https://github.com/gohugoio/hugo/issues/6161#issuecomment-574336088 * https://github.com/gohugoio/hugo/issues/6161#issuecomment-596805273 Fixes #6161
2021-02-16modules: Add config option modules.vendorClosestBjørn Erik Pedersen
Fixes #8235 Fixes #8242
2021-01-19build(deps): bump github.com/spf13/afero from 1.4.1 to 1.5.1Robert-André Mauchin
Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
2020-12-30Add Dart Sass supportBjørn Erik Pedersen
But note that the Dart Sass Embedded Protocol is still in beta (beta 5), a main release scheduled for Q1 2021. Fixes #7380 Fixes #8102
2020-12-16all: Fix minor typosPhil Davis
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-11-03Make js.Build fully support modulesBjørn Erik Pedersen
Fixes #7816 Fixes #7777 Fixes #7916
2020-10-22Allow getJSON errors to be ignoredBjørn Erik Pedersen
This change is mostly motivated to get a more stable CI build (we're building the Hugo site there, with Instagram and Twitter shortcodes sometimes failing). Fixes #7866
2020-10-06Allow cascade to be a slice with a _target discriminatorBjørn Erik Pedersen
Fixes #7782
2020-09-13Add "hugo mod npm pack"Bjørn Erik Pedersen
This commit also introduces a convention where these common JS config files, including `package.hugo.json`, gets mounted into: ``` assets/_jsconfig ´`` These files mapped to their real filename will be added to the environment when running PostCSS, Babel etc., so you can do `process.env.HUGO_FILE_TAILWIND_CONFIG_JS` to resolve the real filename. But do note that `assets` is a composite/union filesystem, so if your config file is not meant to be overridden, name them something specific. This commit also adds adds `workDir/node_modules` to `NODE_PATH` and `HUGO_WORKDIR` to the env when running the JS tools above. Fixes #7644 Fixes #7656 Fixes #7675