mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 23:38:53 +00:00
content: Document new features in v0.151.0
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
a46898f797
commit
e424b6b19a
@@ -44,20 +44,42 @@ The HTTP cache involves two key aspects: determining which content to cache (the
|
||||
|
||||
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.
|
||||
|
||||
The default configuration disables everything:
|
||||
This is the default configuration for HTTP caching:
|
||||
|
||||
{{< code-toggle file=hugo >}}
|
||||
[HTTPCache.cache.for]
|
||||
excludes = ['**']
|
||||
includes = []
|
||||
{{< /code-toggle >}}
|
||||
{{< code-toggle config=HTTPCache />}}
|
||||
|
||||
respectCacheControlNoStoreInRequest
|
||||
: {{< new-in 0.151.0 />}}
|
||||
: (`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`.
|
||||
|
||||
respectCacheControlNoStoreInResponse
|
||||
: {{< new-in 0.151.0 />}}
|
||||
: (`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`.
|
||||
|
||||
cache.for.excludes
|
||||
: (`string`) A list of [glob](g) patterns to exclude from caching.
|
||||
: (`string`) A list of [glob](g) patterns to exclude from caching. In its default configuration HTTP caching excludes all files.
|
||||
|
||||
cache.for.includes
|
||||
: (`string`) A list of [glob](g) patterns to cache.
|
||||
|
||||
polls
|
||||
: A slice of polling configurations.
|
||||
|
||||
polls.disable
|
||||
: (`bool`) Whether to disable polling for this configuration. Default is `true`.
|
||||
|
||||
polls.high
|
||||
: (`string`) The maximum polling interval expressed as a [duration](g). This is used when the resource is considered stable. Default is `0s`.
|
||||
|
||||
polls.low
|
||||
: (`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`.
|
||||
|
||||
polls.for.excludes
|
||||
: (`string`) A list of [glob](g) patterns to exclude from polling for this configuration.
|
||||
|
||||
polls.for.includes
|
||||
: (`string`) A list of [glob](g) patterns to include in polling for this configuration.
|
||||
|
||||
## HTTP polling
|
||||
|
||||
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
|
||||
: A slice of polling configurations.
|
||||
|
||||
polls.disable
|
||||
: (`bool`) Whether to disable polling for this configuration.
|
||||
|
||||
polls.low
|
||||
: (`string`) The minimum polling interval expressed as a [duration](g). This is used after a recent change and gradually increases towards `polls.high`.
|
||||
: (`bool`) Whether to disable polling for this configuration. Default is `true`.
|
||||
|
||||
polls.high
|
||||
: (`string`) The maximum polling interval expressed as a [duration](g). This is used when the resource is considered stable.
|
||||
: (`string`) The maximum polling interval expressed as a [duration](g). This is used when the resource is considered stable. Default is `0s`.
|
||||
|
||||
polls.low
|
||||
: (`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`.
|
||||
|
||||
polls.for.excludes
|
||||
: (`string`) A list of [glob](g) patterns to exclude from polling for this configuration.
|
||||
|
||||
@@ -94,6 +94,22 @@ enable = true
|
||||
|
||||
With this configuration, to format text as deleted, wrap it with double-tildes.
|
||||
|
||||
#### Footnote
|
||||
|
||||
Enabled by default, the Footnote extension enables inclusion of footnotes in Markdown.
|
||||
|
||||
enable
|
||||
: {{< new-in 0.151.0 />}}
|
||||
: (`bool`) Whether to enable the Footnotes extension. Default is `true`.
|
||||
|
||||
backlinkHTML
|
||||
: {{< new-in 0.151.0 />}}
|
||||
: (`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 ↩︎ (a return arrow symbol).
|
||||
|
||||
enableAutoIDPrefix
|
||||
: {{< new-in 0.151.0 />}}
|
||||
: (`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`.
|
||||
|
||||
#### Passthrough
|
||||
|
||||
{{< new-in 0.122.0 />}}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: transform.HTMLToMarkdown
|
||||
description: Converts HTML to Markdown.
|
||||
categories: []
|
||||
keywords: []
|
||||
params:
|
||||
functions_and_methods:
|
||||
returnType: string
|
||||
signatures: [transform.HTMLToMarkdown INPUT]
|
||||
---
|
||||
|
||||
{{< new-in "0.151.0" />}}
|
||||
|
||||
> [!note]
|
||||
> This function is experimental and its API may change in the future.
|
||||
|
||||
The `transform.HTMLToMarkdown` function converts HTML to Markdown by utilizing the [`html-to-markdown`][] Go package.
|
||||
|
||||
## Usage
|
||||
|
||||
```go-html-template
|
||||
{{ .Content | transform.HTMLToMarkdown | safeHTML }}
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
The conversion process is enabled by the following `html-to-markdown` plugins:
|
||||
|
||||
Plugin|Description
|
||||
:--|:--
|
||||
Base|Implements basic shared functionality
|
||||
CommonMark|Implements Markdown according to the [Commonmark Spec][]
|
||||
Table|Implements tables according to the [GitHub Flavored Markdown Spec][]
|
||||
|
||||
[`html-to-markdown`]: https://github.com/JohannesKaufmann/html-to-markdown?tab=readme-ov-file#readme
|
||||
[Commonmark Spec]: https://spec.commonmark.org/current/
|
||||
[GitHub Flavored Markdown Spec]: https://github.github.com/gfm/
|
||||
+9
-4
@@ -1077,9 +1077,11 @@ config:
|
||||
- '**'
|
||||
high: 0s
|
||||
low: 0s
|
||||
respectCacheControlNoStoreInRequest: true
|
||||
respectCacheControlNoStoreInResponse: false
|
||||
archeTypeDir: archetypes
|
||||
assetDir: assets
|
||||
author: null
|
||||
author: {}
|
||||
baseURL: ""
|
||||
build:
|
||||
buildStats:
|
||||
@@ -1238,7 +1240,10 @@ config:
|
||||
enable: false
|
||||
superscript:
|
||||
enable: false
|
||||
footnote: true
|
||||
footnote:
|
||||
backlinkHTML: '↩︎'
|
||||
enable: true
|
||||
enableAutoIDPrefix: false
|
||||
linkify: true
|
||||
linkifyProtocol: https
|
||||
passthrough:
|
||||
@@ -1908,7 +1913,7 @@ config:
|
||||
- (?i)GET|POST
|
||||
urls:
|
||||
- .*
|
||||
segments: null
|
||||
segments: {}
|
||||
server:
|
||||
headers: null
|
||||
redirects:
|
||||
@@ -1963,7 +1968,7 @@ config:
|
||||
timeout: 60s
|
||||
title: ""
|
||||
titleCaseStyle: AP
|
||||
uglyURLs: null
|
||||
uglyURLs: {}
|
||||
workingDir: ""
|
||||
config_helpers:
|
||||
mergeStrategy:
|
||||
|
||||
Reference in New Issue
Block a user