summaryrefslogtreecommitdiffstats
path: root/hugolib
AgeCommit message (Collapse)Author
2023-05-23Fix regression when config for OutputFormat.BaseName is an empty stringBjørn Erik Pedersen
Fixes #11000
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-22Avoid writing to hugo_stats.json when there are no changesBjørn Erik Pedersen
Fixes #10985
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-20Make language merging of markup etc. config without values in the rootBjørn Erik Pedersen
Updates #10953
2023-05-19Allow legacy taxonomyTerm in disableKindsBjørn Erik Pedersen
Updates #10953
2023-05-18all: Fix comments for exported functions and packagesOleksandr Redko
2023-05-18Allow empty params.mainSectionsBjørn Erik Pedersen
Updates #10953
2023-05-17commands: Improve the common build flag handlingBjørn Erik Pedersen
Updates #10947
2023-05-17Support, but warn, about top level language custom paramsBjø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-05-15Expand the baseline benchmark a littleBjørn Erik Pedersen
2023-04-13Prevent the global error collector to panic when sending on closed channelBjørn Erik Pedersen
2023-03-29Add test for ToC vs includeBjørn Erik Pedersen
See #10866
2023-03-15markup/goldmark: Fail on invalid Markdown attributesBjørn Erik Pedersen
2023-03-12Fix "unknown shortcode token" when calling shortcode within fenced code blockBjørn Erik Pedersen
Fixes #10819
2023-03-12Run gofmt -s on source filesAndreas Deininger
2023-03-10Improve error message for unclosed shortcode with inner contentAndreas 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-04Work around --gc failure on Windows <= 10Bjørn Erik Pedersen
This applies two related fixes/improvements: * The --gc now keeps empty `_resources/_gen/images` etc folders, even if empty. This should have been the behaviour from the start. * Also, if removal of an empty dir on Windows fails with the "used by another process" error, just ignore it for now. Fixes #10781
2023-03-02Correct typos in Go commentsOleksandr Redko
2023-03-01Replace deprecated ioutil with io and osOleksandr Redko
https://pkg.go.dev/io/ioutil is deprecated since Go 1.16.
2023-02-25Add a page template funcBjørn Erik Pedersen
Fixes #9339
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-23Fix shortcode error when closing without .InnerBjørn Erik Pedersen
Fixes #10672
2023-02-23Throw an error when shortcode is expected to be closedBjørn Erik Pedersen
Fixes #10675
2023-02-23Add some shortcode testcasesBjørn Erik Pedersen
Closes #10671
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-26Fix shortcode detection in RenderStringBjørn Erik Pedersen
Fixes #10654
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-17Preserve front matter slice value types (e.g. int)Bjørn Erik Pedersen
Fixes #10624
2023-01-16Make hugo.toml the new config.tomlBjørn Erik Pedersen
Both will of course work, but hugo.toml will win if both are set. We should have done this a long time ago, of course, but the reason I'm picking this up now is that my VS Code setup by default picks up some JSON config schema from some random other software which also names its config files config.toml. Fixes #8979
2023-01-04Misc doc, code refactoring to improve documentationBjørn Erik Pedersen
2022-12-23resource/page: Slight adjustment of Page.AncestorsBjørn Erik Pedersen
Fixes #10567
2022-12-23resource/page: Add Page.AncestorsSepts
Fixes #10567
2022-12-22Annotate test assertionsJoe Mooring
2022-12-22hugolib: Exclude non-linkable pages from translations mapJoe Mooring
Fixes #9073
2022-12-22Add HUGO_PUBLISHDIR to the Node environmentBjørn Erik Pedersen
So you can do `process.env.HUGO_PUBLISHDIR` in your `postcss.config.js` to figure out where Hugo publishes its files. Note that the value will always be an absolute file path and will point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags: ``` hugo server --renderToDisk hugo server --renderStaticToDisk ``` Fixes #10554
2022-12-22Revert "tpl/tplimpl: Use https in sitemap templates"Joe Mooring
This reverts commit 3fd0b78498597ceb343b7fda2e9b652f3e957478.
2022-12-19Add any configured Go Workspace file to the config watcherBjørn Erik Pedersen
Fixes #10556
2022-12-19modules: Make the module.workspace=off as default (note)Bjørn Erik Pedersen
Also, resolve any workspace file relative to the workingDir. Fixes #10553
2022-12-14Also consider wrapped errors when checking for file IsNotExist errorsBjørn Erik Pedersen
Fixes #10534