summaryrefslogtreecommitdiffstats
path: root/hugofs/fs.go
AgeCommit message (Collapse)Author
2023-06-19all: Fix typos in function names and commentsOleksandr Redko
2023-05-28Don't create the public folder unless neededBjørn Erik Pedersen
Fixes #11031
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
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-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-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-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
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-02-19modules: Improve "hugo mod clean"Bjørn Erik Pedersen
* Only clean project modules * Optional glob pattern of module paths to clean Closes #6907
2020-02-19commands: Add "hugo mod verify"Bjørn Erik Pedersen
See #6907
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-23Make Page an interfaceBjørn Erik Pedersen
The main motivation of this commit is to add a `page.Page` interface to replace the very file-oriented `hugolib.Page` struct. This is all a preparation step for issue #5074, "pages from other data sources". But this also fixes a set of annoying limitations, especially related to custom output formats, and shortcodes. Most notable changes: * The inner content of shortcodes using the `{{%` as the outer-most delimiter will now be sent to the content renderer, e.g. Blackfriday. This means that any markdown will partake in the global ToC and footnote context etc. * The Custom Output formats are now "fully virtualized". This removes many of the current limitations. * The taxonomy list type now has a reference to the `Page` object. This improves the taxonomy template `.Title` situation and make common template constructs much simpler. See #5074 Fixes #5763 Fixes #5758 Fixes #5090 Fixes #5204 Fixes #4695 Fixes #5607 Fixes #5707 Fixes #5719 Fixes #3113 Fixes #5706 Fixes #5767 Fixes #5723 Fixes #5769 Fixes #5770 Fixes #5771 Fixes #5759 Fixes #5776 Fixes #5777 Fixes #5778
2017-08-03Add some missing doc commentsJorin Vogel
As pointed out by the linter, some exported functions and types are missing doc comments. The linter warnings have been reduced from 194 to 116. Not all missing comments have been added in this commit though.
2017-06-27hugofs: Fix typo in code commentDamir Vandic
2017-06-13Run gofmt to get imports in line vs gohugoio/hugoBjørn Erik Pedersen
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-03-09all: Fix some govet complaintsAlbert Nigmatzianov
2017-02-17all: Refactor to nonglobal Viper, i18n etc.Bjørn Erik Pedersen
This is a final rewrite that removes all the global state in Hugo, which also enables the use if `t.Parallel` in tests. Updates #2701 Fixes #3016
2017-02-04all: Refactor to nonglobal file systemsBjørn Erik Pedersen
Updates #2701 Fixes #2951
2016-10-24all: Unify case of config variable namesAlbert Nigmatzianov
All config variables starts with low-case and uses camelCase. If there is abbreviation at the beginning of the name, the whole abbreviation will be written in low-case. If there is abbreviation at the end of the name, the whole abbreviation will be written in upper-case. For example, rssURI.
2016-04-10hugofs: Add package docBjørn Erik Pedersen
2016-04-07hugofs: Fix GoDocBjørn Erik Pedersen
2016-03-31Add readFile template funcBjørn Erik Pedersen
This also includes a refactor of the hugofs package and its usage. The motivation for that is: The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...) Fixes #1551
2015-12-07Fix copyright headers in source filesBjørn Erik Pedersen
Still need to add some missing headers and an AUTHORS file. See #1646
2015-11-23Change the license to Apache 2.0Steve Francia
2015-11-16Hugo server renders and serves from memory by default (30%+ improvement)spf13
2015-03-26Add support for Ace base and inner templatesbep
Fixes #994 Fixes #511
2014-11-04Setting to filesystems to the afero.fs interface so can be easily swapped out.spf13
2014-11-01Migrating Hugo to Afero for filesystem calls.spf13