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
AgeCommit message (Collapse)Author
2020-04-21Fix broken testBjørn Erik Pedersen
2020-04-07Add basic "post resource publish support"Bjørn Erik Pedersen
Fixes #7146
2020-03-20Some minify configuration adjustmentsBjørn Erik Pedersen
2020-03-17Add workaround for regular CSS imports in SCSSBjørn Erik Pedersen
Fixes #7059
2020-03-11Improve Tailwind/PostCSS error messagesBjørn Erik Pedersen
Fixes #7041 Fixes #7042
2020-03-03Add build.UseResourceCacheWhenBjørn Erik Pedersen
Fixes #6993
2020-02-27resources: Add basic @import support to resources.PostCSSBjørn Erik Pedersen
This commit also makes the HUGO_ENVIRONMENT environment variable available to Node. Fixes #6957 Fixes #6961
2019-12-19Fix abs path handling in module mountsBjørn Erik Pedersen
Fixes #6622
2019-11-26Fix language handling in ExecuteAsTemplateBjørn Erik Pedersen
Fixes #6331
2019-10-09deps: Update minify to v2.5.2Anthony Fok
- v2.5.1 removes import comments, solving a build error with Go 1.13 in GOPATH mode (used Debian packaging for example) - v2.5.2 no longer converts polyline/rect/polygon/line to path as it has been reported to break a SVG referenced by CSS, see tdewolff/minify#260 The test case for Min SVG in TestResourceChains is updated accordingly. Fixes pocc/tshark.dev#33
2019-09-05Fix concat with fingerprint regressionBjørn Erik Pedersen
In Hugo 0.58 we optimized the transformers that only adjusted metadata, e.g. the fingerprint. This depended on the source readers implementing `io.ReadSeeker`. The reader produced by `concat` did that, but the implementation was buggy. This commit fixes that. Fixes #6309
2019-09-03hugolib: Add a Sass includePaths testBjørn Erik Pedersen
See #6274
2019-09-02Add some fingerprint testsBjørn Erik Pedersen
Closes #6284 Closes #6280
2019-08-26Image resource refactorBjørn Erik Pedersen
This commit pulls most of the image related logic into its own package, to make it easier to reason about and extend. This is also a rewrite of the transformation logic used in Hugo Pipes, mostly to allow constructs like the one below: {{ ($myimg | fingerprint ).Width }} Fixes #5903 Fixes #6234 Fixes #6266
2019-08-13Add resources.Match and resources.GetMatchBjørn Erik Pedersen
Fix #6190
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
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-06-02Add safety barrier between concatenated javascript resourcesVincent Fiduccia
2019-05-29resources: Return nil when not found in resources.GetBjørn Erik Pedersen
Fixes #5999
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
2019-01-02resources: Move resource interfaces into its own packageBjørn Erik Pedersen
2019-01-02resource: Move resource processors into sub-packagesBjørn Erik Pedersen
2018-12-23Rename CSV option from comma to delimiterBjørn Erik Pedersen
See #5555
2018-12-23hugolib: Adjust testBjørn Erik Pedersen
See #5544
2018-12-23Add CSV support to transform.UnmarshalBjørn Erik Pedersen
Fixes #5555
2018-12-23tpl/transform: Add transform.Unmarshal funcBjørn Erik Pedersen
Fixes #5428
2018-12-21Prevent resource publishing for transformed inline resourcesBjørn Erik Pedersen
That is, if only `.Content` is accessed. This means that, for a transformed resource to be published to `/public`, you need to access either `.RelPermalink` or `Permalink`. Fixes #4944
2018-11-15Add tests for permalink on Resource with baseURL with pathBjørn Erik Pedersen
See #5226
2018-10-27resource: Allow .Data.Integrity to be accessed on its ownBjørn Erik Pedersen
Fixes #5296
2018-10-02tpl/collections: Fix handling of different interface types in SliceBjørn Erik Pedersen
In Hugo `0.49` we improved type support in `slice`. This has an unfortunate side effect in that `resources.Concat` now expects something that can resolve to `resource.Resources`. This worked for most situations, but when you try to `slice` different `Resource` objects, you would be getting `[]interface {}` and not `resource.Resources`. And `concat` would fail: ```bash error calling Concat: slice []interface {} not supported in concat. ``` This commit fixes that by simplifying the type checking logic in `Slice`: * If the first item implements the `Slicer` interface, we try that * If the above fails or the first item does not implement `Slicer`, we just return the `[]interface {}` Fixes #5269
2018-08-28hugolib: Only run variable variable overwrite test on Go 1.11Bjørn Erik Pedersen
2018-08-28hugolib: Add a test for template variable overwriteBjørn Erik Pedersen
New in Go 1.11.
2018-08-14Only duplicate resource output in multihost modeBjørn Erik Pedersen
Yesterday's commit was a little too agressive. This commit makes sure that the duplication of resources to public/en etc. is only performed in multihost mode. See #5058
2018-08-06Add support for minification of final outputBjørn Erik Pedersen
Hugo Pipes added minification support for resources fetched via ´resources.Get` and similar. This also adds support for minification of the final output for supported output formats: HTML, XML, SVG, CSS, JavaScript, JSON. To enable, run Hugo with the `--minify` flag: ```bash hugo --minify ``` This commit is also a major spring cleaning of the `transform` package to allow the new minification step fit into that processing chain. Fixes #1251
2018-07-31tocss/scss: Improve _ prefix handling in SCSS importsBjørn Erik Pedersen
See #5008
2018-07-31tocss/scss: Improve SCSS project vs themes import resolutionBjørn Erik Pedersen
Before this commit, only SASS/SCSS components imported from main.scss at first level can be overwritten by homonymous files in projects or over-preceding theme components. This commit fixes that by implementing a custom import resolver which will be tried first. This resolver will make sure that the project/theme hierarchy is always respected. Fixes #5008
2018-07-20resource/scss: Add IncludePaths config optionBjørn Erik Pedersen
Takes paths relative to the current working dir. Fixes #4921
2018-07-12resource: Fix resources.Concat for transformed resourcesBjørn Erik Pedersen
Fixes #4936
2018-07-12Improve type support in resources.ConcatBjørn Erik Pedersen
This allows the result of `.Resources.Match` and similar to be concatenated. Fixes #4934
2018-07-06Add Hugo Piper with SCSS support and much moreBjørn Erik Pedersen
Before this commit, you would have to use page bundles to do image processing etc. in Hugo. This commit adds * A new `/assets` top-level project or theme dir (configurable via `assetDir`) * A new template func, `resources.Get` which can be used to "get a resource" that can be further processed. This means that you can now do this in your templates (or shortcodes): ```bash {{ $sunset := (resources.Get "images/sunset.jpg").Fill "300x200" }} ``` This also adds a new `extended` build tag that enables powerful SCSS/SASS support with source maps. To compile this from source, you will also need a C compiler installed: ``` HUGO_BUILD_TAGS=extended mage install ``` Note that you can use output of the SCSS processing later in a non-SCSSS-enabled Hugo. The `SCSS` processor is a _Resource transformation step_ and it can be chained with the many others in a pipeline: ```bash {{ $css := resources.Get "styles.scss" | resources.ToCSS | resources.PostCSS | resources.Minify | resources.Fingerprint }} <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Digest }}" media="screen"> ``` The transformation funcs above have aliases, so it can be shortened to: ```bash {{ $css := resources.Get "styles.scss" | toCSS | postCSS | minify | fingerprint }} <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Digest }}" media="screen"> ``` A quick tip would be to avoid the fingerprinting part, and possibly also the not-superfast `postCSS` when you're doing development, as it allows Hugo to be smarter about the rebuilding. Documentation will follow, but have a look at the demo repo in https://github.com/bep/hugo-sass-test New functions to create `Resource` objects: * `resources.Get` (see above) * `resources.FromString`: Create a Resource from a string. New `Resource` transformation funcs: * `resources.ToCSS`: Compile `SCSS` or `SASS` into `CSS`. * `resources.PostCSS`: Process your CSS with PostCSS. Config file support (project or theme or passed as an option). * `resources.Minify`: Currently supports `css`, `js`, `json`, `html`, `svg`, `xml`. * `resources.Fingerprint`: Creates a fingerprinted version of the given Resource with Subresource Integrity.. * `resources.Concat`: Concatenates a list of Resource objects. Think of this as a poor man's bundler. * `resources.ExecuteAsTemplate`: Parses and executes the given Resource and data context (e.g. .Site) as a Go template. Fixes #4381 Fixes #4903 Fixes #4858