summaryrefslogtreecommitdiffstats
path: root/hugolib
AgeCommit message (Collapse)Author
2024-05-05Fix one more resource change eviction logic issueBjørn Erik Pedersen
This is how we should have fixed #1239. Fixes #12456
2024-05-04Make the cache eviction logic for stale entities more robustBjørn Erik Pedersen
Fixes #12458
2024-05-02resources/page: Pull internal Page methods into its own interfaceBjørn Erik Pedersen
So it doesn't get visible when passing it to `jsonify`.
2024-05-01Fix rebuilds on cascade deletes/renamesBjørn Erik Pedersen
And also avoid reading sub directories on simple changes to branch `_index.md` files. Fixes #12449
2024-05-01commands: Print "Webserver is ..." right before "Total ..."Bjørn Erik Pedersen
Also fix it so * It's not printed when running `hugo -w` * It'd printed for all kinds of rebuilds Fixes #12384
2024-04-30Make sure replaced pages gets marked as staleBjørn Erik Pedersen
Fixes #12436
2024-04-25config: Setups with only one active language can never be multihostBjørn Erik Pedersen
Fixes #12288
2024-04-25Fix rebuilds when running hugo -wBjørn Erik Pedersen
This was partly broken in Hugo 0.123.0. We have two internal config options that gets set from the CLI: * Running; a web server is running * Watching; either set via `hugo -w` or `hugo server --watch=false` Part of the change detection code wrongly used the `Running` as a flag when `Watching` would be the correct. Fixes #12296
2024-04-22markup/goldmark: Fix data race in the hugocontext wrapperBjørn Erik Pedersen
The window for this to happen is very small, but it has been reported by Go's race detector (-race flag) in a tests once.
2024-04-22tpl: Escape .Title in built-in image and link render hooksBjørn Erik Pedersen
Co-authored-by: Joe Mooring <joe@mooring.com>
2024-04-20Only add root sections to the section pages menuBjørn Erik Pedersen
Fixes #12399
2024-04-20Fix partial rebuilds for SCSS fetched with GetMatch and similarBjørn Erik Pedersen
Fixes #12395
2024-04-16Fix server rebuilds when adding a content file on LinuxBjørn Erik Pedersen
Fixes #12362
2024-04-15hugolib: Add an asciidoc rebuild test caseBjørn Erik Pedersen
See #12375
2024-04-15Pass .RenderShortcodes' Page to render hooks as .PageInnerBjørn Erik Pedersen
The main use case for this is to resolve links and resources (e.g. images) relative to the included `Page`. A typical `include` would similar to this: ```handlebars {{ with site.GetPage (.Get 0) }} {{ .RenderShortcodes }} {{ end }} ``` And when used in a Markdown file: ```markdown {{% include "/posts/p1" %}} ``` Any render hook triggered while rendering `/posts/p1` will get `/posts/p1` when calling `.PageInner`. Note that * This is only relevant for shortcodes included with `{{%` that calls `.RenderShortcodes`. * `.PageInner` is available in all render hooks that, before this commit, received `.Page`. * `.PageInner` will fall back to the value of `.Page` if not relevant and will always have a value. Fixes #12356
2024-04-14helpers: Fix TrimShortHTML when used with AsciiDoc contentJoe Mooring
Fixes #12369
2024-04-13hugolib: Display server address after each rebuildJoe Mooring
Closes #12359
2024-04-11all: Fix duplicate words in commentsEitan Adler
2024-04-11all: Typo fixesChristian Oliff
2024-04-05hugolib: Fix regression for blank summariescuregit
Fix regression in content summarization so that we can use empty summary by using the manual summary divider. Since v0.123, there has been the regression that causes Hugo to use automatic summary generation when the manual summary results in an empty string, even if there is a `<!--more-->` summary divider.
2024-04-05Fix sectionPagesMenu for pages in root levelBjørn Erik Pedersen
Fixes #12306
2024-04-04tpl/tplimpl: Improve youtube shortcodeJoe Mooring
Changes: - Add query string params for controls, loop, mute, start, and end - Add iframe loading attribute - Obtain default iframe title from YouTube oEmbed API - Fix autoplay feature - Improve readability Closes #3694 Closes #9213 Closes #10520 Closes #10575 Closes #10576 Co-authored-by: sgharms <sgharms@stevengharms.com>
2024-04-02Fix resource bundling for overlapping page.md vs page.txtBjørn Erik Pedersen
Fixes #12320
2024-04-02tpl/tplimpl: Optionally exclude content from sitemapJoe Mooring
Define global inclusion/exclusion in site configuration, and override via front matter. For example, to exclude a page from the sitemap: [sitemap] disable = true # default is false Closes #653 Closes #12282 Co-authored-by: kolappannathan <kolappannathan@users.noreply.github.com> Co-authored-by: felicianotech <FelicianoTech@gmail.com>
2024-04-01tpl/tplimpl: Remove trailing slash from void elementsJoe Mooring
Closes #11867
2024-03-28tpl/tplimpl: Update schema templateJoe Mooring
Changes: - Remove trailing comma from list of keywords. - Improve keywords precedence: 1. Use "keywords" term page titles. 2. Use "keywords" from front matter if "keywords" is not a taxonomy. 3. Use "tags" term page titles. 4. Use term page titles from all taxonomies. - Enable schema for all page kinds, previously limited to kind = page. - Remove trailing slashes from void elements. - Improve readability. Closes #7570 Co-authored by: 0urobor0s <0urobor0s@users.noreply.github.com>
2024-03-26tpl/tplimpl: Update Google Analytics template and configJoe Mooring
Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Changes: - Update tpl/tplimpl/embedded/templates/google_analytics.html - Remove tpl/tplimpl/embedded/templates/google_analytics_async.html - Remove extraneous config settings Closes #11802 Closes #10093
2024-03-26hugolib: Conditionally suppress .Site.Author deprecation noticeJoe Mooring
Suppress the .Site.Author deprecation notice unless the Author key is present and not empty in the site configuration. Closes #12297
2024-03-20Fix potential deadlock in TranslationsBjørn Erik Pedersen
Fixes #12129
2024-03-20Fix rebuild when changing mixed case named templatesBjørn Erik Pedersen
Fixes #12165
2024-03-19Fix regression for outputs defined in front matter for term pagesBjørn Erik Pedersen
Fixes #12275
2024-03-16Add segments config + --renderSegments flagBjørn Erik Pedersen
Named segments can be defined in `hugo.toml`. * Eeach segment consists of zero or more `exclude` filters and zero or more `include` filters. * Eeach filter consists of one or more field Glob matchers. * Eeach filter in a section (`exclude` or `include`) is ORed together, each matcher in a filter is ANDed together. The current list of fields that can be filtered are: * path as defined in https://gohugo.io/methods/page/path/ * kind * lang * output (output format, e.g. html). It is recommended to put coarse grained filters (e.g. for language and output format) in the excludes section, e.g.: ```toml [segments.segment1] [[segments.segment1.excludes]] lang = "n*" [[segments.segment1.excludes]] no = "en" output = "rss" [[segments.segment1.includes]] term = "{home,term,taxonomy}" [[segments.segment1.includes]] path = "{/docs,/docs/**}" ``` By default, Hugo will render all segments, but you can enable filters by setting the `renderSegments` option or `--renderSegments` flag, e.g: ``` hugo --renderSegments segment1,segment2 ``` For segment `segment1` in the configuration above, this will: * Skip rendering of all languages matching `n*`, e.g. `no`. * Skip rendering of the output format `rss` for the `en` language. * It will render all pages of kind `home`, `term` or `taxonomy` * It will render the `/docs` section and all pages below. Fixes #10106
2024-03-16Fix .Parent when there are overlapping regular pages inbetweenBjørn Erik Pedersen
Fixes #12263
2024-03-16hugolib: Remove Site.HomeAbsURLBjørn Erik Pedersen
It's not in use and after #12266 it's also not corret to use on its own (use .Site.Home.Permalink).
2024-03-16hugolib: Fix sitemap index with monolingual siteJoe Mooring
Fixes #12266
2024-03-15hugolib: Deprecate site methods Author, Authors, and SocialJoe Mooring
Closes #12228
2024-03-15Fix translationKey handling for term pagesBjørn Erik Pedersen
Fixes #12261
2024-03-15Fix intersect and similar for term entry page collectionsBjørn Erik Pedersen
Fixes #12254
2024-03-15Fix server rebuilds when adding sub sections especially on WindowsBjørn Erik Pedersen
This commit also optimizes for the case where change events for both file (e.g. `_index.md`) and the container directory comes in the same event batch. While testing this on Windows 11 (ARM64), I notice that Windows behaves a little oddly when dumping a folder of files into the content tree; it works (at least after this commit), but it seems like the event batching behaves differently compared to other OSes (even older Win versions). A related tip would be to try starting the server with polling, to see if that improves the situation, e.g.: ``` hugo server --poll 700ms ``` Fixes #12230
2024-03-14tpl/tplimpl: Modify figure shortcode to look for page resourceJoe Mooring
Closes #12244 Closes #12245
2024-03-13Fix panic when changing archetype files when servere is runningBjørn Erik Pedersen
Fixes #12195
2024-03-13Fix Name for nested resourced fetched in resources.ByName and similarBjørn Erik Pedersen
Fixes #12214
2024-03-13common/hugo: Rename IsMultiHost and IsMultiLingualJoe Mooring
hugo.IsMultiHost => hugo.IsMultihost hugo.IsMultiLingual => hugo.IsMultilingual Closes #12232
2024-03-10hugolib: Deprecate .Site.MultiLingual in favor of hugo.IsMultiLingualJoe Mooring
Closes #12224
2024-03-07Don't auto-create empty sections for nested taxonomiesBjørn Erik Pedersen
Fixes #12188
2024-03-07Fix resource name in resources.ByTypeBjørn Erik Pedersen
Fixes #12190
2024-03-07Fix section page resource not published if resource filename partially ↵Bjørn Erik Pedersen
matches content file name Fixes #12198
2024-03-07Fix taxonomy kind template lookup issueBjørn Erik Pedersen
Fixes #12193
2024-03-01hugofs: Fix vertical mount merge issueBjørn Erik Pedersen
Fixes #12175
2024-03-01Fix and add integration test for the Bootstrap SCSS module for both Dart ↵Bjørn Erik Pedersen
Sass and Libsass This fixes the reverse filesystem lookup (absolute filename to path relative to the composite filesystem). The old logic had some assumptions about the locality of the actual files that didn't work in more complex scenarios. This commit now also adds the popular Bootstrap SCSS Hugo module to the CI build (both for libsass and dartsass transpiler), so we can hopefully avoid similar future breakage. Fixes #12178