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.
When creating a link to a file with a `#` in the filename, the link gets
truncated. This happens because the filename is eventaully passed to
`url.Parse` which (correctly!) interprets the `#` as fragment separator.
This commit escapes the `#` in the filename before creating the link.
Fixes#4926Fixes#8232Fixes#12342
Co-authored-by: Joe Mooring <joe.mooring@veriphor.com>
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#653Closes#12282
Co-authored-by: kolappannathan <kolappannathan@users.noreply.github.com>
Co-authored-by: felicianotech <FelicianoTech@gmail.com>
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>
This replaces the current implementation with `json.MarshalIndent` which doesn't produce the same output, but at least it doesn't crash.
There's a bug in the upstream `litter` library. This can probably be fixed, but that needs to wait.
I have tested `go-spew` which does not crash, but it is very data racy in this context.
FIxes#12309
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
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