mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-09 12:57:22 -04:00
Miscellaneous edits
This commit is contained in:
parent
8c3700d128
commit
e4eb484575
@ -24,7 +24,7 @@ Hugo comes with all the code you need to load Disqus into your templates. Before
|
||||
|
||||
Disqus comments require you set a single value in your [site's configuration file][configuration] like so:
|
||||
|
||||
{{< code-toggle file="hugo" >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.disqus]
|
||||
shortname = 'your-disqus-shortname'
|
||||
{{</ code-toggle >}}
|
||||
|
@ -139,8 +139,8 @@ To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file
|
||||
|
||||
```yaml
|
||||
variables:
|
||||
HUGO_VERSION: 0.115.1
|
||||
DART_SASS_VERSION: 1.63.6
|
||||
HUGO_VERSION: 0.121.0
|
||||
DART_SASS_VERSION: 1.69.5
|
||||
GIT_DEPTH: 0
|
||||
GIT_STRATEGY: clone
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
@ -173,8 +173,8 @@ To install Dart Sass for your builds on Netlify, the `netlify.toml` file should
|
||||
|
||||
```toml
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.115.1"
|
||||
DART_SASS_VERSION = "1.63.6"
|
||||
HUGO_VERSION = "0.121.0"
|
||||
DART_SASS_VERSION = "1.69.5"
|
||||
TZ = "America/Los_Angeles"
|
||||
|
||||
[build]
|
||||
|
@ -10,6 +10,8 @@ action:
|
||||
signatures: [transform.XMLEscape INPUT]
|
||||
---
|
||||
|
||||
{{< new-in 0.121.0 >}}
|
||||
|
||||
The `transform.XMLEscape` function removes [disallowed characters] as defined in the XML specification, then escapes the result by replacing the following characters with [HTML entities]:
|
||||
|
||||
- `"` → `"`
|
||||
@ -24,7 +26,7 @@ The `transform.XMLEscape` function removes [disallowed characters] as defined in
|
||||
For example:
|
||||
|
||||
```go-html-template
|
||||
transform.XMLEscape "<p>abc</p>" → <p>abc</p>
|
||||
{{ transform.XMLEscape "<p>abc</p>" }} → <p>abc</p>
|
||||
```
|
||||
|
||||
When using `transform.XMLEscape` in a template rendered by Go's [html/template] package, declare the string to be safe HTML to avoid double escaping. For example, in an RSS template:
|
||||
|
@ -44,13 +44,13 @@ In addition to using a single site configuration file, one can use the `configDi
|
||||
- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc...
|
||||
- Each file's content must be top-level, for example:
|
||||
|
||||
{{< code-toggle file="hugo" copy=false >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[Params]
|
||||
foo = "bar"
|
||||
foo = 'bar'
|
||||
{{< /code-toggle >}}
|
||||
|
||||
{{< code-toggle file="params" copy=false >}}
|
||||
foo = "bar"
|
||||
{{< code-toggle file=params >}}
|
||||
foo = 'bar'
|
||||
{{< /code-toggle >}}
|
||||
|
||||
- Each directory holds a group of files containing settings unique to an environment.
|
||||
@ -78,7 +78,7 @@ Let's take an example to understand this better. Let's say you are using Google
|
||||
|
||||
[Google tag ID]: https://support.google.com/tagmanager/answer/12326985?hl=en
|
||||
|
||||
{{< code-toggle file=hugo copy=false >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.googleAnalytics]
|
||||
ID = 'G-XXXXXXXXX'
|
||||
{{< /code-toggle >}}
|
||||
@ -103,7 +103,7 @@ To satisfy these requirements, configure your site as follows:
|
||||
|
||||
Include this section only:
|
||||
|
||||
{{< code-toggle file=hugo copy=false >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.googleAnalytics]
|
||||
ID = 'G-PPPPPPPPP'
|
||||
{{< /code-toggle >}}
|
||||
@ -116,7 +116,7 @@ To satisfy these requirements, configure your site as follows:
|
||||
|
||||
Include this section only:
|
||||
|
||||
{{< code-toggle file=hugo copy=false >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.googleAnalytics]
|
||||
ID = 'G-SSSSSSSSS'
|
||||
{{< /code-toggle >}}
|
||||
@ -789,6 +789,10 @@ Hugo v0.20 introduced the ability to render your content to multiple output form
|
||||
|
||||
## Configure minify
|
||||
|
||||
See the [tdewolff/minify] project page for details.
|
||||
|
||||
[tdewolff/minify]: https://github.com/tdewolff/minify
|
||||
|
||||
Default configuration:
|
||||
|
||||
{{< code-toggle config=minify />}}
|
||||
|
@ -99,7 +99,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HUGO_VERSION: 0.120.4
|
||||
HUGO_VERSION: 0.121.0
|
||||
steps:
|
||||
- name: Install Hugo CLI
|
||||
run: |
|
||||
|
@ -27,8 +27,8 @@ Define your [CI/CD](https://docs.gitlab.com/ee/ci/quick_start/) jobs by creating
|
||||
|
||||
{{< code file=.gitlab-ci.yml copy=true >}}
|
||||
variables:
|
||||
DART_SASS_VERSION: 1.64.1
|
||||
HUGO_VERSION: 0.115.4
|
||||
DART_SASS_VERSION: 1.69.5
|
||||
HUGO_VERSION: 0.121.0
|
||||
NODE_VERSION: 20.x
|
||||
GIT_DEPTH: 0
|
||||
GIT_STRATEGY: clone
|
||||
|
@ -57,14 +57,14 @@ For production:
|
||||
|
||||
{{< code file=netlify.toml >}}
|
||||
[context.production.environment]
|
||||
HUGO_VERSION = "0.115.4"
|
||||
HUGO_VERSION = "0.121.0"
|
||||
{{< /code >}}
|
||||
|
||||
For testing:
|
||||
|
||||
{{< code file=netlify.toml >}}
|
||||
[context.deploy-preview.environment]
|
||||
HUGO_VERSION = "0.115.4"
|
||||
HUGO_VERSION = "0.121.0"
|
||||
{{< /code >}}
|
||||
|
||||
The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`:
|
||||
|
@ -28,14 +28,14 @@ Use the `Fragments` method on a `Page` object to create a table of contents with
|
||||
## Methods
|
||||
|
||||
Headings
|
||||
: (`map`) A nested map of all headings on the page. Each map contains the following keys: `ID`, `Title` and `Headings`. To inspect the data structure:
|
||||
: (`map`) A nested map of all headings on the page. Each map contains the following keys: `ID`, `Level`, `Title` and `Headings`. To inspect the data structure:
|
||||
|
||||
```go-html-template
|
||||
<pre>{{ .Fragments.Headings | jsonify (dict "indent" " ") }}</pre>
|
||||
```
|
||||
|
||||
HeadingsMap
|
||||
: (`slice`) A slice of maps of all headings on the page, with first-level keys for each heading. Each map contains the following keys: `ID`, `Title` and `Headings`. To inspect the data structure:
|
||||
: (`slice`) A slice of maps of all headings on the page, with first-level keys for each heading. Each map contains the following keys: `ID`, `Level`, `Title` and `Headings`. To inspect the data structure:
|
||||
|
||||
```go-html-template
|
||||
<pre>{{ .Fragments.HeadingsMap | jsonify (dict "indent" " ") }}</pre>
|
||||
|
@ -26,7 +26,7 @@ Hugo ships with an internal template supporting [Google Analytics 4].
|
||||
Provide your tracking ID in your configuration file:
|
||||
|
||||
**Google Analytics 4 (gtag.js)**
|
||||
{{< code-toggle file="hugo" >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.googleAnalytics]
|
||||
ID = "G-MEASUREMENT_ID"
|
||||
{{</ code-toggle >}}
|
||||
@ -49,7 +49,7 @@ Hugo also ships with an internal template for [Disqus comments][disqus], a popul
|
||||
|
||||
To use Hugo's Disqus template, first set up a single configuration value:
|
||||
|
||||
{{< code-toggle file="hugo" >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[services.disqus]
|
||||
shortname = 'your-disqus-shortname'
|
||||
{{</ code-toggle >}}
|
||||
@ -187,7 +187,7 @@ Hugo uses the page title and description for the card's title and description fi
|
||||
|
||||
Set the value of `twitter:site` in your site configuration:
|
||||
|
||||
{{< code-toggle file="hugo" copy=false >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[params.social]
|
||||
twitter = "GoHugoIO"
|
||||
{{</ code-toggle >}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user