Skip to content

Commit e424b6b

Browse files
jmooringbep
authored andcommitted
content: Document new features in v0.151.0
1 parent a46898f commit e424b6b

File tree

4 files changed

+96
-16
lines changed

4 files changed

+96
-16
lines changed

‎content/en/configuration/http-cache.md‎

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,42 @@ The HTTP cache involves two key aspects: determining which content to cache (the
4444

4545
The HTTP cache behavior is defined for a configured set of resources. Stale resources will be refreshed from the file cache, even if their configured Time-To-Live (TTL) has not expired. If HTTP caching is disabled for a resource, Hugo will bypass the cache and access the file directly.
4646

47-
The default configuration disables everything:
47+
This is the default configuration for HTTP caching:
4848

49-
{{< code-toggle file=hugo >}}
50-
[HTTPCache.cache.for]
51-
excludes = ['**']
52-
includes = []
53-
{{< /code-toggle >}}
49+
{{< code-toggle config=HTTPCache />}}
50+
51+
respectCacheControlNoStoreInRequest
52+
: {{< new-in 0.151.0 />}}
53+
: (`bool`) Whether to respect the `no-store` directive in the server's `Cache-Control` request header when fetching remote resources via the [`resources.GetRemote`][] function. Default is `true`.
54+
55+
respectCacheControlNoStoreInResponse
56+
: {{< new-in 0.151.0 />}}
57+
: (`bool`) Whether to respect the `no-store` directive in the server's `Cache-Control` response header when fetching remote resources via the [`resources.GetRemote`][] function. Default is `false`.
5458

5559
cache.for.excludes
56-
: (`string`) A list of [glob](g) patterns to exclude from caching.
60+
: (`string`) A list of [glob](g) patterns to exclude from caching. In its default configuration HTTP caching excludes all files.
5761

5862
cache.for.includes
5963
: (`string`) A list of [glob](g) patterns to cache.
6064

65+
polls
66+
: A slice of polling configurations.
67+
68+
polls.disable
69+
: (`bool`) Whether to disable polling for this configuration. Default is `true`.
70+
71+
polls.high
72+
: (`string`) The maximum polling interval expressed as a [duration](g). This is used when the resource is considered stable. Default is `0s`.
73+
74+
polls.low
75+
: (`string`) The minimum polling interval expressed as a [duration](g). This is used after a recent change and gradually increases towards `polls.high`. Default is `0s`.
76+
77+
polls.for.excludes
78+
: (`string`) A list of [glob](g) patterns to exclude from polling for this configuration.
79+
80+
polls.for.includes
81+
: (`string`) A list of [glob](g) patterns to include in polling for this configuration.
82+
6183
## HTTP polling
6284

6385
Polling is used in watch mode (e.g., `hugo server`) to detect changes in remote resources. Polling can be enabled even if HTTP caching is disabled. Detected changes trigger a rebuild of pages using the affected resource. Polling can be disabled for specific resources, typically those known to be static.
@@ -78,13 +100,13 @@ polls
78100
: A slice of polling configurations.
79101

80102
polls.disable
81-
: (`bool`) Whether to disable polling for this configuration.
82-
83-
polls.low
84-
: (`string`) The minimum polling interval expressed as a [duration](g). This is used after a recent change and gradually increases towards `polls.high`.
103+
: (`bool`) Whether to disable polling for this configuration. Default is `true`.
85104

86105
polls.high
87-
: (`string`) The maximum polling interval expressed as a [duration](g). This is used when the resource is considered stable.
106+
: (`string`) The maximum polling interval expressed as a [duration](g). This is used when the resource is considered stable. Default is `0s`.
107+
108+
polls.low
109+
: (`string`) The minimum polling interval expressed as a [duration](g). This is used after a recent change and gradually increases towards `polls.high`. Default is `0s`.
88110

89111
polls.for.excludes
90112
: (`string`) A list of [glob](g) patterns to exclude from polling for this configuration.

‎content/en/configuration/markup.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ enable = true
9494

9595
With this configuration, to format text as deleted, wrap it with double-tildes.
9696

97+
#### Footnote
98+
99+
Enabled by default, the Footnote extension enables inclusion of footnotes in Markdown.
100+
101+
enable
102+
: {{< new-in 0.151.0 />}}
103+
: (`bool`) Whether to enable the Footnotes extension. Default is `true`.
104+
105+
backlinkHTML
106+
: {{< new-in 0.151.0 />}}
107+
: (`string`) The HTML to be displayed at the end of a footnote that links the user back to the corresponding reference in the main text. The default is &#x21a9;&#xfe0e; (a return arrow symbol).
108+
109+
enableAutoIDPrefix
110+
: {{< new-in 0.151.0 />}}
111+
: (`bool`) Whether to prependsa unique prefix to footnote IDs, preventing clashes when multiple documents are rendered together. This prefix is unique to each logical path, which means that the prefix is not unique across content dimensions such as language. Default is `false`.
112+
97113
#### Passthrough
98114

99115
{{< new-in 0.122.0 />}}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: transform.HTMLToMarkdown
3+
description: Converts HTML to Markdown.
4+
categories: []
5+
keywords: []
6+
params:
7+
functions_and_methods:
8+
returnType: string
9+
signatures: [transform.HTMLToMarkdown INPUT]
10+
---
11+
12+
{{< new-in "0.151.0" />}}
13+
14+
> [!note]
15+
> This function is experimental and its API may change in the future.
16+
17+
The `transform.HTMLToMarkdown` function converts HTML to Markdown by utilizing the [`html-to-markdown`][] Go package.
18+
19+
## Usage
20+
21+
```go-html-template
22+
{{ .Content | transform.HTMLToMarkdown | safeHTML }}
23+
```
24+
25+
## Plugins
26+
27+
The conversion process is enabled by the following `html-to-markdown` plugins:
28+
29+
Plugin|Description
30+
:--|:--
31+
Base|Implements basic shared functionality
32+
CommonMark|Implements Markdown according to the [Commonmark Spec][]
33+
Table|Implements tables according to the [GitHub Flavored Markdown Spec][]
34+
35+
[`html-to-markdown`]: https://github.com/JohannesKaufmann/html-to-markdown?tab=readme-ov-file#readme
36+
[Commonmark Spec]: https://spec.commonmark.org/current/
37+
[GitHub Flavored Markdown Spec]: https://github.github.com/gfm/

‎data/docs.yaml‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,9 +1077,11 @@ config:
10771077
- '**'
10781078
high: 0s
10791079
low: 0s
1080+
respectCacheControlNoStoreInRequest: true
1081+
respectCacheControlNoStoreInResponse: false
10801082
archeTypeDir: archetypes
10811083
assetDir: assets
1082-
author: null
1084+
author: {}
10831085
baseURL: ""
10841086
build:
10851087
buildStats:
@@ -1238,7 +1240,10 @@ config:
12381240
enable: false
12391241
superscript:
12401242
enable: false
1241-
footnote: true
1243+
footnote:
1244+
backlinkHTML: '&#x21a9;&#xfe0e;'
1245+
enable: true
1246+
enableAutoIDPrefix: false
12421247
linkify: true
12431248
linkifyProtocol: https
12441249
passthrough:
@@ -1908,7 +1913,7 @@ config:
19081913
- (?i)GET|POST
19091914
urls:
19101915
- .*
1911-
segments: null
1916+
segments: {}
19121917
server:
19131918
headers: null
19141919
redirects:
@@ -1963,7 +1968,7 @@ config:
19631968
timeout: 60s
19641969
title: ""
19651970
titleCaseStyle: AP
1966-
uglyURLs: null
1971+
uglyURLs: {}
19671972
workingDir: ""
19681973
config_helpers:
19691974
mergeStrategy:

0 commit comments

Comments
 (0)