summaryrefslogtreecommitdiffstats
path: root/resources
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-19tocss/dartsas: Avoid using Logf for the internal Dart Sass loggingBjørn Erik Pedersen
As that does not work when percentages are used in the log messages.
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-06-14Re-add site.RSSLink (and deprecate it)Bjørn Erik Pedersen
Fixes #11110
2023-06-14Fix .Width and .Height for animated gifsBjørn Erik Pedersen
Fixes #11079
2023-06-12resources: Remove failing and superflous test assertionBjørn Erik Pedersen
2023-06-12Upgrade to v2 of the Dart Sass Embedded ProtocolBjørn Erik Pedersen
Fixes #11059
2023-06-12Fix indented SASS imports for Dart SassBjørn Erik Pedersen
Fixes #11074
2023-05-29Fix potential deadlock in ByParamBjørn Erik Pedersen
Fixes #11039
2023-05-28Fix Processed images count regression for multiple languagesBjørn Erik Pedersen
Fixes #11002
2023-05-27Add language.LanguageCodeBjørn Erik Pedersen
But keep an alias at Site Closes #11027
2023-05-22Revert "postcss: Improve validation of option 'config'"Bjørn Erik Pedersen
This reverts commit 9a0370e8eb71fed3ac04984020b6aa95c43f22ab. Closes #10990
2023-05-22postcss: Improve validation of option 'config'Andreas Deininger
2023-05-22Add cache busting config to support Tailwind 3Bjørn Erik Pedersen
Fixes #10974
2023-05-20Allow whitelisting mediaTypes used in resources.GetRemoteBjørn Erik Pedersen
Fixes #10286
2023-05-20Add hugo.WorkingDirBjørn Erik Pedersen
Fixes #10969
2023-05-18all: Fix comments for exported functions and packagesOleksandr Redko
2023-05-17Re-add site.LanguagePrefixBjørn Erik Pedersen
Updates #10947
2023-05-17Handle transient errors in config loading etc.Bjørn Erik Pedersen
As in: Get the Kubernetes site to build with the new Hugo version. Updates #10947
2023-05-17Deprecate site.Language.Params and some other fixesBjørn Erik Pedersen
Updates #10947
2023-05-16Add Sections to Site interfaceBjørn Erik Pedersen
See https://github.com/gohugoio/hugo/issues/10947#issuecomment-1550012671 Updates #10947
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-20resources.functions: improve validationAndreas Deininger
2023-03-20resources: Fix typos in error message and variablesOleksandr Redko
2023-03-12Run gofmt -s on source filesAndreas Deininger
2023-03-10Don't fail when calling Paginate with an empty pages.PagesGroupBjørn Erik Pedersen
Fixes #10802
2023-03-05Fix .Fragments when called cross sites on uninitialized output formatBjørn Erik Pedersen
Fixes #10794
2023-03-05Allow page.TableOfContents on self in shortcodeBjørn Erik Pedersen
Fixes #10791
2023-03-04Fix "context canceled" with partialBjørn Erik Pedersen
Make sure the context used for timeouts isn't created based on the incoming context, as we have cases where this can cancel the context prematurely. Fixes #10789
2023-03-04Page context handling in i18nBjørn Erik Pedersen
This is a workaround. We need to improve on this, but not today. Fixes #10782
2023-03-02Correct typos in Go commentsOleksandr Redko
2023-03-01Misc ioutil deprecation adjustmentsBjørn Erik Pedersen
To make the tests pass. * Replace io => os.ReadFile in magefile.go * Adjust failing image test vs fs.DirEntry * Adjust poller test See #10732
2023-03-01Replace deprecated ioutil with io and osOleksandr Redko
https://pkg.go.dev/io/ioutil is deprecated since Go 1.16.
2023-02-26exif: Return the proper exposure time value in some special casesWaltCuller
Return value in float64 if exposure time is int or greater than 1, otherwise return in fraction. Fixes #10738
2023-02-25Add a page template funcBjørn Erik Pedersen
Fixes #9339
2023-02-24dartsass: Import CSS without extension at compile timeJoe Mooring
Applicable to Dart Sass only: - Sass imports with the .css extension indicate a plain CSS @import. - Sass imports without the .css extension are imported at compile time. Fixes #10592
2023-02-24Split parse and render for GoldmarkBjørn Erik Pedersen
This also speeds up situations where you only need the fragments/toc and not the rendered content, e.g. Related with fragments type indexing: ```bash name old time/op new time/op delta RelatedSite-10 12.3ms ± 2% 10.7ms ± 1% -12.95% (p=0.029 n=4+4) name old alloc/op new alloc/op delta RelatedSite-10 38.6MB ± 0% 38.2MB ± 0% -1.08% (p=0.029 n=4+4) name old allocs/op new allocs/op delta RelatedSite-10 117k ± 0% 115k ± 0% -1.36% (p=0.029 n=4+4) ``` Fixes #10750
2023-02-23related: Add config option cardinalityThresholdBjørn Erik Pedersen
Fixes #10744
2023-02-23sass: Remove some unused leftover codeBjørn Erik Pedersen
2023-02-23resources/sass: Remove debug statementsJoe Mooring
Closes #10470
2023-02-22page: Move the cache double check right after the lockBjørn Erik Pedersen
2023-02-22page: Add some concurrency to the building of the related page indexBjørn Erik Pedersen
But only in the case where we know that we will need to access the Page fragments/tableofcontents. In normal situations this will spread naturally across the CPU cores, but not in the situation where `site.RegularPages.Related` gets called as part of e.g. the single template. ```bash name old time/op new time/op delta RelatedSite-10 18.0ms ± 2% 11.9ms ± 1% -34.17% (p=0.029 n=4+4) name old alloc/op new alloc/op delta RelatedSite-10 38.6MB ± 0% 38.6MB ± 0% ~ (p=0.114 n=4+4) name old allocs/op new allocs/op delta RelatedSite-10 117k ± 0% 117k ± 0% +0.23% (p=0.029 n=4+4) ``` See #10711
2023-02-22tocss: Simplify the hugo:vars type handlingBjørn Erik Pedersen
Instead of maintaing a list of all CSS units and functions this commit: * Uses 3 regexps to detect typed CSS values (e.g. `24px`) + properly handle numeric Go types. * These regexps may have some false positives -- e.g. strings that needs to be quoted. * For that rare case, you can mark the string with e.g. `"32xxx" | css.Quoted` * For the opposite case: `"32" | css.Unquoted` Updates #10632
2023-02-22resource_transformers/tocss: Fixed hugo:vars castingAcClassic
Variables passed via the hugo:vars function where passed as type string. This caused problems when using the variables in sass functions because these expect a specific type. Now we check if the passed variables have to be quoted and therefore are of type string or if they should not be quoted and let the type interpretation up to the sass compiler. Fixes #10632
2023-02-21Add page fragments support to RelatedBjørn Erik Pedersen
The main topic of this commit is that you can now index fragments (content heading identifiers) when calling `.Related`. You can do this by: * Configure one or more indices with type `fragments` * The name of those index configurations maps to an (optional) front matter slice with fragment references. This allows you to link page<->fragment and page<->page. * This also will index all the fragments (heading identifiers) of the pages. It's also possible to use type `fragments` indices in shortcode, e.g.: ``` {{ $related := site.RegularPages.Related .Page }} ``` But, and this is important, you need to include the shortcode using the `{{<` delimiter. Not doing so will create infinite loops and timeouts. This commit also: * Adds two new methods to Page: Fragments (can also be used to build ToC) and HeadingsFiltered (this is only used in Related Content with index type `fragments` and `enableFilter` set to true. * Consolidates all `.Related*` methods into one, which takes either a `Page` or an options map as its only argument. * Add `context.Context` to all of the content related Page API. Turns out it wasn't strictly needed for this particular feature, but it will soon become usefil, e.g. in #9339. Closes #10711 Updates #9339 Updates #10725
2023-01-25Only invoke a given cached partial onceBjørn Erik Pedersen
Note that this is backed by a LRU cache (which we soon shall see more usage of), so if you're a heavy user of cached partials it may be evicted and refreshed if needed. But in most cases every partial is only invoked once. This commit also adds a timeout (the global `timeout` config option) to make infinite recursion in partials easier to reason about. ``` name old time/op new time/op delta IncludeCached-10 8.92ms ± 0% 8.48ms ± 1% -4.87% (p=0.016 n=4+5) name old alloc/op new alloc/op delta IncludeCached-10 6.65MB ± 0% 5.17MB ± 0% -22.32% (p=0.002 n=6+6) name old allocs/op new allocs/op delta IncludeCached-10 117k ± 0% 71k ± 0% -39.44% (p=0.002 n=6+6) ``` Closes #4086 Updates #9588
2023-01-17Fix permalinks issue with repeated sectionsBjørn Erik Pedersen
Fixes #10377
2023-01-16Add fill HTTP Response info into .Data in resources.GetRemoteBjørn Erik Pedersen
See #10604