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
2021-11-08Fix path resolution in hugo newBjørn Erik Pedersen
With theme and project with content directories and command on the form `hugo new posts/test.md`. Fixes #9129
2021-11-01Update Twitter shortcode oEmbed endpointJoe Mooring
The existing endpoint will be retired and removed on November 23, 2021. References: - https://twittercommunity.com/t/consolidating-the-oembed-functionality/154690 - https://developer.twitter.com/en/docs/twitter-for-websites/oembed-api#Embedded This is a backward compatible change. The existing endpoint requires a single parameter: the id of the tweet. The new endpoint requires two parameters: the id of the tweet, and the user with whom it is associated. For the moment, if you supply the wrong user, the request will be redirected (with a small delay) to the correct user/id pair. This behavior is undocumented, but we will take advantage of it as Hugo site authors transition to the new syntax. {{< tweet 1453110110599868418 >}} --> works, throws warning, deprecate at some point {{< tweet user="SanDiegoZoo" id="1453110110599868418" >}} --> new syntax Fixes #8130
2021-10-25Fix panic when specifying multiple excludeFiles directivesBjørn Erik Pedersen
Fixes #9076
2021-10-22config: Set HUGO_ENABLEGITINFO=false override in Set_in_stringAnthony Fok
This allows TestLoadConfigWithOsEnvOverrides/Set_in_string to PASS even if there is no .git directory, e.g. during Debian package build.
2021-10-20hugofs: Add includeFiles and excludeFiles to mount configurationBjørn Erik Pedersen
Fixes #9042
2021-10-18Fix file permissions in new archetype implementationBjørn Erik Pedersen
Closes #9057
2021-10-18Add a cross process build lock and use it in the archetype content builderBjørn Erik Pedersen
Fixes #9048
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-10-10Fix value of useResourceCacheWhen in TestResourceChainPostCSSJoe Mooring
2021-10-09Skip a test assertion on CIBjørn Erik Pedersen
Need to investigate later, but got to get the tests green.
2021-09-22Pass minification errors to the userPaul Gottschling
Previously, *minifyTransformation.Transform suppressed the error returned by t.m.Minify. This meant that when minification returned an error, the error would not reach the user. Instead, minification would silently fail. For example, if a JavaScript file included a call to the Date constructor with: new Date(2020, 04, 02) The package that the minification library uses to parse JS files, github.com/tdewolff/parse would return an error, since "04" would be parsed as a legacy octal. However, the JS file would remain un-minified with no error. Fixing this is not as simple as replacing "_" with an "err" in *minifyTransformation.Transform, however (though this is necessary). If we only returned this error from Transform, then hugolib.TestResourceMinifyDisabled would fail. Instead of being a no-op, as TestResourceMinifyDisabled expects, using the "minify" template function with a "disableXML=true" config setting instead returns the error, "minifier does not exist for mimetype." The "minifier does not exist" error is returned because of the way minifiers.New works. If the user's config disables minification for a particular MIME type, minifiers.New does not add it to the resulting Client's *minify.M. However, this also means that when the "minify" template function is executed, a *resourceAdapter's transformations still add a minification. When it comes time to call the minify.Minifier for a specific MIME type via *M.MinifyMimetype, the github.com/tdewolff/minify library throws the "does not exist" error for the missing MIME type. The solution was to change minifiers.New so, instead of skipping a minifier for each disabled MIME type, it adds a NoOpMinifier, which simply copies the source to the destination without minification. This means that when the "minify" template function is used for a particular resource, and that resource's MIME type has minification disabled, minification is genuinely skipped, and does not result in an error. In order to add this, I've fixed a possibly unwanted interaction between minifiers.TestConfigureMinify and hugolib.TestResourceMinifyDisabled. The latter disables minification and expects minification to be a no-op. The former disables minification and expects it to result in an error. The only reason hugolib.TestResourceMinifyDisabled passes in the original code is that the "does not exist" error is suppressed. However, we shouldn't suppress minification errors, since they can leave users perplexed. I've changed the test assertion in minifiers.TestConfigureMinify to expect no errors and a no-op if minification is disabled for a particular MIME type. Fixes #8954
2021-08-31commands: Don't fail on template errors on go mod graph etc.Bjørn Erik Pedersen
Fixes #8942
2021-08-31Avoid failing with "module not found" for hugo mod init and similarBjørn Erik Pedersen
Fixes #8940
2021-08-22Fix it so disableKinds etc. does not get merged in from themeBjørn Erik Pedersen
Unless the merge strategy is set up to do so. For `disableKinds` the current workaround is to make sure the project config has an entry, even if is empty: ``` disableKinds = [] ``` Note that this issue only touches root, non-map config-values that either is not set in project config or in Hugo's defaults. Fixes #8866
2021-08-22Prevent minifier from removing quoutes around post-processed attributesBjørn Erik Pedersen
Fixes #8884
2021-08-21highlight: Remove some pygments referencesHelder Pereira
2021-08-03Make sure module config loading errors have file positioning infoBjørn Erik Pedersen
Fixes #8845
2021-08-02Reduce binary size vs locale, update to CLDR v36.1Bjørn Erik Pedersen
Test building with `go build -ldflags="-s -w"` Hugo 0.86.2: 46MB Before this commit: 77MB After this commit: 54MB Fixes #8839 Fixes #8841
2021-08-01Fix error handling for the time func aliasBjørn Erik Pedersen
Fixes #8835
2021-08-01Fail on invalid time zoneBjørn Erik Pedersen
Fixes #8832
2021-07-30Improve handling of <nil> ParamsBjørn Erik Pedersen
Fixes #8825
2021-07-29tpl/lang: Add new localized versions of lang.FormatNumber etc.Bjørn Erik Pedersen
Fixes #8820
2021-07-28Handle toml.LocalDate and toml.LocalDateTime in front matterBjørn Erik Pedersen
See #8801
2021-07-28Switch to go-toml v2Bjørn Erik Pedersen
We have been using `go-toml` for language files only. This commit makes it the only TOML library. It's spec compliant and very fast. A benchark building a site with 200 pages with TOML front matter: ```bash name old time/op new time/op delta SiteNew/Regular_TOML_front_matter-16 48.5ms ± 1% 47.1ms ± 1% -2.85% (p=0.029 n=4+4) name old alloc/op new alloc/op delta SiteNew/Regular_TOML_front_matter-16 16.9MB ± 0% 16.7MB ± 0% -1.56% (p=0.029 n=4+4) name old allocs/op new allocs/op delta SiteNew/Regular_TOML_front_matter-16 302k ± 0% 296k ± 0% -2.20% (p=0.029 n=4+4) ``` Note that the front matter unmarshaling is only a small part of building a site, so the above is very good. Fixes #8801
2021-07-27Add a TOML front matter benchmarkBjørn Erik Pedersen
2021-07-27Add timezone support for front matter dates without oneBjørn Erik Pedersen
Fixes #8810
2021-07-27Localize time.FormatBjørn Erik Pedersen
Fixes #8797
2021-07-26deps: Update github.com/evanw/esbuild v0.11.16 => v0.12.16Bjørn Erik Pedersen
2021-07-26Deprecate Blackfriday and fix a potential deadlock in configBjørn Erik Pedersen
Note that the deadlock has not been seen earlier, in tests on in real Hugo sites. Fixes #8792 Fixes #8791
2021-07-25Bump all long-living deprecations to ERRORsBjørn Erik Pedersen
2021-07-20Simplify "active menu" logic for section menusBjørn Erik Pedersen
Fixes #8776
2021-07-20Fix Params case handling for menu items defined in site configBjørn Erik Pedersen
Fixes #8775
2021-07-20minifiers: Make keepWhitespace = true default for HTMLBjørn Erik Pedersen
Fixes #8771
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-07-15markup: Add tabindex="0" to default <pre> wrapperrhymes
Currently the generated `<pre>` element isn't fully accessible as it can't be focused by keyboard users. To make this fully accessible, the attribute `tabindex="0"` should be added to the `<pre>` tag. Closes #7194
2021-07-15Fix default values when loading from config dirBjørn Erik Pedersen
By waiting until we've loaded the config dir config before applying the default values. Fixes #8763
2021-07-15markup/goldmark: Support auto links in render hookBjørn Erik Pedersen
Fixes #8755
2021-07-14Adjust a test helperBjørn Erik Pedersen
2021-07-10Add config.cascadeBjørn Erik Pedersen
This commit adds support for using the `cascade` keyword in your configuration file(s), e.g. `config.toml`. Note that * Every feature of `cascade` is available, e.g. `_target` to target specific page sets. * Pages, e.g. the home page, can overwrite the cascade defined in config. Fixes #8741
2021-07-05Fix tab selection of disabled items in internal pagination templateRaoul
2021-07-05commands: Make the --poll flag a durationBjørn Erik Pedersen
So you can do: ``` hugo server --poll 700ms ``` See #8720
2021-07-03Fix panic when theme has permalinks configBjørn Erik Pedersen
Fixes #8724
2021-06-29Fix date format in schema and opengraph templatesJoe Mooring
Fixes #8671
2021-06-29config: Fix handling of invalid OS env config overridesBjørn Erik Pedersen
Fixes #8709
2021-06-27Fix config loading for "hugo mod init"Bjørn Erik Pedersen
We have some commands that will continue even if the config loading fails (e.g. because a module can not be found). In Hugo 0.84.0 we introduced a new `_merge` flag that we removed once the configuration was loaded. But we did not do that in error situations, leading to failures in some situations. This commit fixes that by making sure the configuration is always cleaned before return, even in error situations. Fixes #8697
2021-06-24Fix language menu config regressionBjørn Erik Pedersen
Fixes #8672
2021-06-22config: Fix merge of config with map[string]string values.Bjørn Erik Pedersen
Fixes #8679
2021-06-18Implement configuration in a directory for modulesBjørn Erik Pedersen
Fixes #8654
2021-06-18Split out the puthe path/filepath functions into common/pathsBjørn Erik Pedersen
So they can be used from the config package without cyclic troubles. Updates #8654
2021-06-16Do not read config from os.Environ when running testsBjørn Erik Pedersen
Fixes #8655