Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework troubleshooting #2320

Merged
merged 4 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,18 @@
"dring",
"getenv",
"gohugo",
"inor",
"jdoe",
"milli",
"rgba",
"rsmith",
"stringifier",
"struct",
"tdewolff",
"tjones",
"toclevels",
"vals"
"vals",
"xfeff",
"zgotmplz"
]
}
4 changes: 2 additions & 2 deletions content/en/content-management/image-processing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ The default value is 75. You may override the default value in the [site configu

### Hint

<!-- Specifies a libwebp preset, not a libwebp image hint. -->
Applicable to WebP images, this option corresponds to a set of predefined encoding parameters, and is equivalent to the `-preset` flag for the [`cwebp`] encoder.

Applicable to WebP images, this option corresponds to a set of predefined encoding parameters.
[`cwebp`]: https://developers.google.com/speed/webp/docs/cwebp

Value|Example
:--|:--
Expand Down
12 changes: 7 additions & 5 deletions content/en/content-management/summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ toc: true
aliases: [/content/summaries/,/content-management/content-summaries/]
---

<!--more-->

With the use of the `.Summary` [page variable][pagevariables], Hugo generates summaries of content to use as a short version in summary views.

## Summary splitting options
Expand All @@ -37,7 +39,7 @@ The Hugo-defined summaries are set to use word count calculated by splitting the

### Manual summary splitting

Alternatively, you may add the <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> summary divider where you want to split the article.
Alternatively, you may add the `<!--more-->` summary divider where you want to split the article.

For [Org mode content][org], use `# more` where you want to split the article.

Expand All @@ -51,10 +53,10 @@ Pros
: Freedom, precision, and improved rendering. All HTML tags and formatting are preserved.

Cons
: Extra work for content authors, since they need to remember to type <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> (or `# more` for [org content][org]) in each content file. This can be automated by adding the summary divider below the front matter of an [archetype](/content-management/archetypes/).
: Extra work for content authors, since they need to remember to type `<!--more-->` (or `# more` for [org content][org]) in each content file. This can be automated by adding the summary divider below the front matter of an [archetype](/content-management/archetypes/).

{{% note %}}
Be careful to enter <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> exactly; i.e., all lowercase and with no whitespace.
Be careful to enter `<!--more-->` exactly; i.e., all lowercase and with no whitespace.
{{% /note %}}

### Front matter summary
Expand All @@ -71,12 +73,12 @@ Cons

Because there are multiple ways in which a summary can be specified it is useful to understand the order of selection Hugo follows when deciding on the text to be returned by `.Summary`. It is as follows:

1. If there is a <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> summary divider present in the article the text up to the divider will be provided as per the manual summary split method
1. If there is a `<!--more-->`> summary divider present in the article the text up to the divider will be provided as per the manual summary split method
2. If there is a `summary` variable in the article front matter the value of the variable will be provided as per the front matter summary method
3. The text at the start of the article will be provided as per the automatic summary split method

{{% note %}}
Hugo uses the _first_ of the above steps that returns text. So if, for example, your article has both `summary` variable in its front matter and a <code>&#60;&#33;&#45;&#45;more&#45;&#45;&#62;</code> summary divider Hugo will use the manual summary split method.
Hugo uses the _first_ of the above steps that returns text. So if, for example, your article has both `summary` variable in its front matter and a `<!--more-->` summary divider Hugo will use the manual summary split method.
{{% /note %}}

## Example: first 10 articles with summaries
Expand Down
5 changes: 4 additions & 1 deletion content/en/functions/images/Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ quality
```

hint
: Applicable to WebP images. Specify zero or one of `drawing`, `icon`, `photo`, `picture`, or `text`. Default is `photo`. See&nbsp;[details](/content-management/image-processing/#hint).
: Applicable to WebP images and equivalent to the `-preset` flag for the [`cwebp`] encoder. Specify zero or one of `drawing`, `icon`, `photo`, `picture`, or `text`. Default is `photo`. See&nbsp;[details](/content-management/image-processing/#hint).

[`cwebp`]: https://developers.google.com/speed/webp/docs/cwebp


```go-html-template
{{ $filter := images.Process "webp" "icon" }}
Expand Down
6 changes: 3 additions & 3 deletions content/en/functions/safe/CSS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ In this context, *safe* means CSS content that matches any of the following:

Example: Given `style = "color: red;"` defined in the front matter of your `.md` file:

* <span class="good">`<p style="{{ .Params.style | safeCSS }}">…</p>` &rarr; `<p style="color: red;">…</p>`</span>
* <span class="bad">`<p style="{{ .Params.style }}">…</p>` &rarr; `<p style="ZgotmplZ">…</p>`</span>
* `<p style="{{ .Params.style | safeCSS }}">…</p>` &rarr; `<p style="color: red;">…</p>`
* `<p style="{{ .Params.style }}">…</p>` &rarr; `<p style="ZgotmplZ">…</p>`

{{% note %}}
"ZgotmplZ" is a special value that indicates that unsafe content reached a CSS or URL context.
`ZgotmplZ` is a special value that indicates that unsafe content reached a CSS or URL context.
{{% /note %}}
4 changes: 2 additions & 2 deletions content/en/functions/safe/JS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Template authors are responsible for ensuring that typed expressions do not brea

Example: Given `hash = "619c16f"` defined in the front matter of your `.md` file:

* <span class="good">`<script>var form_{{ .Params.hash | safeJS }};…</script>` &rarr; `<script>var form_619c16f;…</script>`</span>
* <span class="bad">`<script>var form_{{ .Params.hash }};…</script>` &rarr; `<script>var form_"619c16f";…</script>`</span>
* `<script>var form_{{ .Params.hash | safeJS }};…</script>` &rarr; `<script>var form_619c16f;…</script>`
* `<script>var form_{{ .Params.hash }};…</script>` &rarr; `<script>var form_"619c16f";…</script>`
7 changes: 6 additions & 1 deletion content/en/functions/transform/Emojify.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ aliases: [/functions/emojify]

See the list of [emoji shortcodes] for available emoticons.

The `emojify` function can be called in your templates but not directly in your content files by default. For emojis in content files, set `enableEmoji` to `true` in your site's [configuration]. Then you can write emoji shorthand directly into your content files; e.g. <code>I :</code><code>heart</code><code>: Hugo!</code>:
The `emojify` function can be called in your templates but not directly in your content files by default. For emojis in content files, set `enableEmoji` to `true` in your site's [configuration]. Then you can write emoji shorthand directly into your content files;


```text
I :heart: Hugo!
```

I :heart: Hugo!

Expand Down
3 changes: 1 addition & 2 deletions content/en/getting-started/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ menu:
weight: 60
weight: 60
type: glossary
# Use level 3 headings for each term in the glossary.
---

<!-- Use level 3 headings for each term in the glossary. -->

### action

See [template action](#template-action).
Expand Down
2 changes: 1 addition & 1 deletion content/en/hugo-pipes/js.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ defines
format
: (`string`) The output format.
One of: `iife`, `cjs`, `esm`.
Default is `iife`, a self-executing function, suitable for inclusion as a <script> tag.
Default is `iife`, a self-executing function, suitable for inclusion as a `<script>` tag.

sourceMap
: (`string`) Whether to generate `inline` or `external` source maps from esbuild. External source maps will be written to the target with the output file name + ".map". Input source maps can be read from js.Build and node modules and combined into the output source maps. By default, source maps are not created.
Expand Down
4 changes: 3 additions & 1 deletion content/en/methods/resource/_common/processing-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ quality
: Applicable to JPEG and WebP images. Optionally specify `qN` where `N` is an integer in the range [0, 100]. Default is `75`. See&nbsp;[details](/content-management/image-processing/#quality).

hint
: Applicable to WebP images. Specify zero or one of `drawing`, `icon`, `photo`, `picture`, or `text`. Default is `photo`. See&nbsp;[details](/content-management/image-processing/#hint).
: Applicable to WebP images and equivalent to the `-preset` flag for the [`cwebp`] encoder. Specify zero or one of `drawing`, `icon`, `photo`, `picture`, or `text`. Default is `photo`. See&nbsp;[details](/content-management/image-processing/#hint).

[`cwebp`]: https://developers.google.com/speed/webp/docs/cwebp

background color
: When converting a PNG or WebP with transparency to a format that does not support transparency, optionally specify a background color using a 3-digit or a 6-digit hexadecimal color code. Default is `#ffffff` (white). See&nbsp;[details](/content-management/image-processing/#background-color).
Expand Down
Loading