Skip to content

Commit

Permalink
Miscellaneous edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Nov 11, 2023
1 parent ec53b55 commit e1c6ecd
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 19 deletions.
26 changes: 13 additions & 13 deletions content/en/content-management/related.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,36 +127,36 @@ If you add a `related` configuration section, you need to add a complete configu
### Top level configuration options

threshold
: A value between 0-100. Lower value will give more, but maybe not so relevant, matches.
: (`int`) A value between 0-100. Lower value will give more, but maybe not so relevant, matches.

includeNewer
: Set to true to include **pages newer than the current page** in the related content listing. This will mean that the output for older posts may change as new related content gets added.
: (`bool`) Set to `true` to include **pages newer than the current page** in the related content listing. This will mean that the output for older posts may change as new related content gets added.

toLower
: Set to true to lower case keywords in both the indexes and the queries. This may give more accurate results at a slight performance penalty. Note that this can also be set per index.
: (`bool`) Set to `true` to lower case keywords in both the indexes and the queries. This may give more accurate results at a slight performance penalty. Note that this can also be set per index.

### Configuration options per index

name
: The index name. This value maps directly to a page parameter. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
: (`string`) The index name. This value maps directly to a page parameter. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.

type
: {{< new-in "0.111.0" >}}. One of `basic`(default) or `fragments`.
type {{< new-in "0.111.0" >}}
: (`string`) One of `basic`(default) or `fragments`.

applyFilter
: {{< new-in "0.111.0" >}}. Apply a `type` specific filter to the result of a search. This is currently only used for the `fragments` type.
applyFilter {{< new-in "0.111.0" >}}
: (`string`) Apply a `type` specific filter to the result of a search. This is currently only used for the `fragments` type.

weight
: An integer weight that indicates _how important_ this parameter is relative to the other parameters. It can be 0, which has the effect of turning this index off, or even negative. Test with different values to see what fits your content best.
: (`int`) An integer weight that indicates _how important_ this parameter is relative to the other parameters. It can be `0`, which has the effect of turning this index off, or even negative. Test with different values to see what fits your content best.

cardinalityThreshold (default 0)
: {{< new-in "0.111.0" >}}. A percentage (0-100) used to remove common keywords from the index. As an example, setting this to 50 will remove all keywords that are used in more than 50% of the documents in the index.
cardinalityThreshold {{< new-in "0.111.0" >}}
: (`int`) A percentage (0-100) used to remove common keywords from the index. As an example, setting this to `50` will remove all keywords that are used in more than 50% of the documents in the index. Default is `0`.

pattern
: This is currently only relevant for dates. When listing related content, we may want to list content that is also close in time. Setting "2006" (default value for date indexes) as the pattern for a date index will add weight to pages published in the same year. For busier blogs, "200601" (year and month) may be a better default.
: (`string`) This is currently only relevant for dates. When listing related content, we may want to list content that is also close in time. Setting "2006" (default value for date indexes) as the pattern for a date index will add weight to pages published in the same year. For busier blogs, "200601" (year and month) may be a better default.

toLower
: See above.
: (`bool`) See above.

## Performance considerations

Expand Down
12 changes: 12 additions & 0 deletions content/en/contribute/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ Rendered:

These shortcodes are commonly used throughout the documentation. Other shortcodes are available for specialized use.

### new-in

Use the "new-in" shortcode to indicate a new feature.

```text
{{</* new-in 0.120.0 */>}}
```

Rendered:

{{< new-in 0.120.0 >}}

### note

Use the "note" shortcode with `{{%/* */%}}` delimiters to call attention to important content:
Expand Down
2 changes: 1 addition & 1 deletion content/en/functions/images/Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This filter has the same options as the [`Process`] method on a `Resource` objec
The process specification is a space-delimited, case-insensitive list of one or more of the following in any sequence:

action
: Specify zero or one of `resize`, `fit`, `fill`, or `crop`. If you specify an action you must also provide dimensions. See&nbsp;[details](content-management/image-processing/#image-processing-methods).
: Specify zero or one of `crop`, `fill`, `fit`, or `resize`. If you specify an action you must also provide dimensions. See&nbsp;[details](content-management/image-processing/#image-processing-methods).

```go-html-template
{{ $filter := images.Process "resize 300x" }}
Expand Down
4 changes: 3 additions & 1 deletion content/en/methods/page/PlainWords.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ action:
The `PlainWords` method on a `Page` object calls the [`Plain`] method, then uses Go's [`strings.Fields`] function to split the result into words.

{{% note %}}
_Fields splits the string s around each instance of one or more consecutive white space characters, as defined by unicode.IsSpace, returning a slice of substrings of s or an empty slice if s contains only white space._
_Fields splits the string s around each instance of one or more consecutive white space characters, as defined by [`unicode.IsSpace`], returning a slice of substrings of s or an empty slice if s contains only white space._

[`unicode.IsSpace`]: https://pkg.go.dev/unicode#IsSpace
{{% /note %}}

As a result, elements within the slice may contain leading or trailing punctuation.
Expand Down
2 changes: 1 addition & 1 deletion content/en/methods/resource/Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ action:
toc: true
---

Process an image with the given specification. The specification can contain an optional action, one of `resize`, `crop`, `fit` or `fill`. This means that you can use this method instead of [`Crop`], [`Fill`], [`Fit`], or [`Resize`].
Process an image with the given specification. The specification can contain an optional action, one of `crop`, `fill`, `fit`, or `resize`. This means that you can use this method instead of [`Crop`], [`Fill`], [`Fit`], or [`Resize`].

```go-html-template
{{ with resources.Get "images/original.jpg" }}
Expand Down
2 changes: 1 addition & 1 deletion content/en/methods/resource/_common/processing-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
The process specification is a space-delimited, case-insensitive list of one or more of the following in any sequence:

action
: Applicable to the [`Process`](/methods/resource/process) method only. Specify zero or one of `resize`, `fit`, `fill`, or `crop`. If you specify an action you must also provide dimensions.
: Applicable to the [`Process`](/methods/resource/process) method only. Specify zero or one of `crop`, `fill`, `fit`, or `resize`. If you specify an action you must also provide dimensions.

dimensions
: Provide width _or_ height when using the [`Resize`](/methods/resource/resize) method, else provide both width _and_ height. See&nbsp;[details](/content-management/image-processing/#dimensions).
Expand Down
4 changes: 2 additions & 2 deletions content/en/troubleshooting/audit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ _Tested with GNU Bash 5.1 and GNU grep 3.7._
: By default, Hugo strips raw HTML from your markdown prior to rendering, and leaves this HTML comment in its place.

`ZgotmplZ`
: ZgotmplZ is a special value that indicates that unsafe content reached a CSS or URL context at runtime. For more information see. See&nbsp;[details].
: ZgotmplZ is a special value that indicates that unsafe content reached a CSS or URL context at runtime. See&nbsp;[details].

[details]: https://pkg.go.dev/html/template

Expand All @@ -70,4 +70,4 @@ _Tested with GNU Bash 5.1 and GNU grep 3.7._
: Same as above when the value returned from the `printf` function has not been passed through `safeHTML`.

`HAHAHUGO`
: Under certain conditions a rendered shortcode may include all or a portion of the string H&#xfeff;AHAHUGOSHORTCODE in either uppercase or lowercase. This is difficult to detect in all circumstances because, but a case-insensitive search of the output for `HAHAHUGO` is likely to catch the majority of cases without producing false positives.
: Under certain conditions a rendered shortcode may include all or a portion of the string H&#xfeff;AHAHUGOSHORTCODE in either uppercase or lowercase. This is difficult to detect in all circumstances, but a case-insensitive search of the output for `HAHAHUGO` is likely to catch the majority of cases without producing false positives.
11 changes: 11 additions & 0 deletions content/en/troubleshooting/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Hugo’s [forum] is an active community of users and developers who answer quest

These are just a few of the questions most frequently asked by new users.

An error message indicates that a feature is not available. Why?
: Hugo is available in two editions: standard and extended. With the extended edition you can (a) encode to the WebP format when processing images, and (b) transpile Sass to CSS using the embedded LibSass transpiler. The extended edition is not required to use the Dart Sass transpiler.
: When you attempt to perform either of the operations above with the standard edition, Hugo throws this error:

```go-html-template
Error: this feature is not available in your current Hugo version
```

: To resolve, uninstall the standard edition, then install the extended edition. See the [installation] section for details.

Why do I see "Page Not Found" when visiting the home page?
: In the content/_index.md file:

Expand Down Expand Up @@ -82,4 +92,5 @@ For other questions please visit the [forum]. A quick search of over 20,000 topi
[`Paginator`]: /methods/page/paginator
[context]: /getting-started/glossary/#context
[forum]: https://discourse.gohugo.io
[installation]: /installation
[requesting help]: https://discourse.gohugo.io/t/requesting-help/9132

0 comments on commit e1c6ecd

Please sign in to comment.