Skip to content

Commit

Permalink
Miscellaneous edits towards the goal of consisent language
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Mar 10, 2024
1 parent a4893d9 commit 85ae97b
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 91 deletions.
4 changes: 2 additions & 2 deletions content/en/content-management/formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ The current list of content formats in Hugo:

| Name | Markup identifiers | Comment |
| ------------- | ------------- |-------------|
| Goldmark | `markdown`, `goldmark` |Note that you can set the default handler of `md` and `Markdown` to something else, see [Configure Markup](/getting-started/configuration-markup/).|
| Goldmark | `markdown`, `goldmark` |Note that you can set the default handler of `md` and `markdown` to something else, see [Configure Markup](/getting-started/configuration-markup/).|
|Emacs Org-Mode|`org`|See [go-org](https://github.com/niklasfasching/go-org).|
|AsciiDoc|`asciidocext`, `adoc`, `ad`|Needs [Asciidoctor][ascii] installed.|
|RST|`rst`|Needs [RST](https://docutils.sourceforge.io/rst.html) installed.|
|Pandoc|`pandoc`, `pdc`|Needs [Pandoc](https://www.pandoc.org/) installed.|
|HTML|`html`, `htm`|To be treated as a content file, with layout, shortcodes etc., it must have front matter. If not, it will be copied as-is.|

The `markup identifier` is fetched from either the `markup` variable in front matter or from the file extension. For markup-related configuration, see [Configure Markup](/getting-started/configuration-markup/).
The `markup` identifier is fetched from either the `markup` field in front matter or from the file extension. For markup-related configuration, see [Configure Markup](/getting-started/configuration-markup/).

## External helpers

Expand Down
2 changes: 1 addition & 1 deletion content/en/content-management/front-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ genres = ['mystery','romance']
author = 'John Smith'
{{< /code-toggle >}}

You can add taxonomy terms to the front matter of any these [page kinds]:
You can add taxonomy terms to the front matter of any these [page kinds]:

- `home`
- `page`
Expand Down
22 changes: 12 additions & 10 deletions content/en/content-management/image-processing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,21 @@ You may also access EXIF fields individually, using the [`lang.FormatNumber`] fu
{{ end }}
```

#### EXIF variables
#### EXIF methods

.Date
: Image creation date/time. Format with the [time.Format] function.
Date
: (`time.Time`) Returns the image creation date/time. Format with the [`time.Format`]function.

.Lat
: GPS latitude in degrees.
[time.Format]: /functions/time/format/

Lat
: (`float64`) Returns the GPS latitude in degrees.

.Long
: GPS longitude in degrees.
Long
: (`float64`) Returns the GPS longitude in degrees.

.Tags
: A collection of the available EXIF tags for this image. You may include or exclude specific tags from this collection in the [site configuration](#exif-data).
Tags
: (`exif.Tags`) Returns a collection of the available EXIF tags for this image. You may include or exclude specific tags from this collection in the [site configuration].

## Image processing options

Expand Down Expand Up @@ -500,7 +502,7 @@ If you change image processing methods or options, or if you rename or remove im
hugo --gc
```

[time.Format]: /functions/time/format/

[`anchor`]: /content-management/image-processing#anchor
[mounted]: /hugo-modules/configuration#module-configuration-mounts
[page bundle]: /content-management/page-bundles/
Expand Down
2 changes: 1 addition & 1 deletion content/en/content-management/multilingual.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ To support Multilingual mode in your themes, some considerations must be taken f
* Come from the built-in `.Permalink` or `.RelPermalink`
* Be constructed with the [`relLangURL`] or [`absLangURL`] template function, or be prefixed with `{{ .LanguagePrefix }}`

If there is more than one language defined, the `LanguagePrefix` variable will equal `/en` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string (and is therefore harmless for single-language Hugo websites).
If there is more than one language defined, the `LanguagePrefix` method will return `/en` (or whatever the current language is). If not enabled, it will be an empty string (and is therefor harmless for single-language Hugo websites).

## Generate multilingual content with `hugo new content`

Expand Down
11 changes: 1 addition & 10 deletions content/en/content-management/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The `<` character indicates that the shortcode's inner content does *not* need f

### Nested shortcodes

You can call shortcodes within other shortcodes by creating your own templates that leverage the `.Parent` variable. `.Parent` allows you to check the context in which the shortcode is being called. See [Shortcode templates][sctemps].
You can call shortcodes within other shortcodes by creating your own templates that leverage the `.Parent` method. `.Parent` allows you to check the context in which the shortcode is being called. See [Shortcode templates][sctemps].

## Embedded shortcodes

Expand Down Expand Up @@ -443,19 +443,10 @@ To learn how to configure your Hugo site to meet the new EU privacy regulation,

To learn more about creating custom shortcodes, see the [shortcode template documentation].

[`figure` shortcode]: #figure
[contentmanagementsection]: /content-management/formats/
[examplegist]: https://gist.github.com/spf13/7896402
[figureelement]: https://html5doctor.com/the-figure-figcaption-elements/
[Hugo and the GDPR]: /about/hugo-and-gdpr/
[Instagram]: https://www.instagram.com/
[pagevariables]: /methods/page/
[partials]: /templates/partials/
[quickstart]: /getting-started/quick-start/
[sctemps]: /templates/shortcode-templates/
[scvars]: /methods/shortcode/
[shortcode template documentation]: /templates/shortcode-templates/
[templatessection]: /templates/
[Vimeo]: https://vimeo.com/
[YouTube Videos]: https://www.youtube.com/
[YouTube Input shortcode]: #youtube
11 changes: 6 additions & 5 deletions content/en/content-management/summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ 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.
With the use of the [`Summary`] method on `Page` object, Hugo generates summaries of content to use as a short version in summary views.

## Summary splitting options

* Automatic Summary Split
* Manual Summary Split
* Front Matter Summary

It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables].
It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the [`RelPermalink`], [`Permalink`], and [`Truncated`] methods.

### Automatic summary splitting

Expand Down Expand Up @@ -105,6 +103,9 @@ You can show content summaries with the following code. You could use the follow

Note how the `.Truncated` boolean variable value may be used to hide the "Read More..." link when the content is not truncated; i.e., when the summary contains the entire article.

[`Permalink`]: /methods/page/permalink/
[`RelPermalink`]: /methods/page/relpermalink/
[`Summary`]: /methods/page/summary/
[`Truncated`]: /methods/page/truncated/
[org]: /content-management/formats/
[pagevariables]: /methods/page/
[section template]: /templates/section-templates/
33 changes: 9 additions & 24 deletions content/en/content-management/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ A collection of textile samples lay spread out on the table - Samsa was a travel

Hugo will take this Markdown and create a table of contents from `## Introduction`, `## My Heading`, and `### My Subheading` and then store it in the [page variable][pagevars]`.TableOfContents`.

The built-in `.TableOfContents` variables outputs a `<nav id="TableOfContents">` element with a child `<ul>`, whose child `<li>` elements begin with appropriate HTML headings. See [the available settings](/getting-started/configuration-markup/#table-of-contents) to configure what heading levels you want to include in TOC.
The `.TableOfContents` method a `Page` object outputs a `<nav id="TableOfContents">` element with a child `<ul>`, whose child `<li>` elements begin with appropriate HTML headings. See [the available settings](/getting-started/configuration-markup/#table-of-contents) to configure what heading levels you want to include in TOC.

## Template example: basic TOC

Expand All @@ -66,51 +66,36 @@ The following is an example of a very basic [single page template]:

## Template example: TOC partial

The following is a [partial template][partials] that adds slightly more logic for page-level control over your table of contents. It assumes you are using a `toc` field in your content's [front matter] that, unless specifically set to `false`, will add a TOC to any page with a `.WordCount` (see [Page Variables][pagevars]) greater than 400. This example also demonstrates how to use [conditionals] in your templating:

{{< code file=layouts/partials/toc.html >}}
{{ if and (gt .WordCount 400 ) (.Params.toc) }}
<aside>
<header>
<h2>{{ .Title }}</h2>
</header>
{{ .TableOfContents }}
</aside>
{{ end }}
{{< /code >}}
The following is a [partial template][partials] that adds slightly more logic for page-level control over your table of contents. It assumes you are using a `toc` field in your content's [front matter] that, unless specifically set to `false`, will add a TOC to any page with a [`WordCount`] greater than 400. This example also demonstrates how to use [conditionals] in your templating:

{{% note %}}
With the preceding example, even pages with > 400 words *and* `toc` not set to `false` will not render a table of contents if there are no headings in the page for the `{{ .TableOfContents }}` variable to pull from.
With the preceding example, even pages with > 400 words *and* `toc` not set to `false` will not render a table of contents if there are no headings in the page for the `.TableOfContents` method to pull from.
{{% /note %}}

## Usage with AsciiDoc

Hugo supports table of contents with AsciiDoc content format.
In the header of your content file, specify the AsciiDoc TOC directives required to generate the table of contents. Then use the `.TableOfContents` method within your template.

In the header of your content file, specify the AsciiDoc TOC directives necessary to ensure that the table of contents is generated. Hugo will use the generated TOC to populate the page variable `.TableOfContents` in the same way as described for Markdown. See example below:

```asciidoc
// <!-- Your front matter up here -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] configuration key
:toclevels: 4

== Introduction

One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.

== My Heading
== Section 1

He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment.
Paragraph 1.

=== My Subheading
== Section 2

A collection of textile samples lay spread out on the table - Samsa was a traveling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops
Paragraph 2.
```

Hugo will take this AsciiDoc and create a table of contents store it in the page variable `.TableOfContents`, in the same as described for Markdown.

[conditionals]: /templates/introduction/#conditional-blocks
[`WordCount`]: /methods/page/wordcount
[front matter]: /content-management/front-matter/
[pagevars]: /methods/page/
[partials]: /templates/partials/
Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ To transform a serialized object into a data structure. For example, transformin

###### variable

A user-defined [identifier](#identifier) prefaced with a `$` symbol, representing a value of any data type, initialized or assigned within a [template action](#template-action). For example, `$foo`&nbsp;and&nbsp;`$bar` are variables.
A user-defined [identifier](#identifier) prepended with a `$` symbol, representing a value of any data type, initialized or assigned within a [template action](#template-action). For example, `$foo`&nbsp;and&nbsp;`$bar` are variables.

###### walk

Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Hugo allows you to set `draft`, `date`, `publishDate`, and `expiryDate` in the [
{{< new-in 0.123.0 >}}

{{% note %}}
Hugo publishes descendants of draft, future, and expired [node] pages. To prevent publication of these descendants, use the [`cascade`] front matter field to cascade [build options] to the descendent pages.
Hugo publishes descendants of draft, future, and expired [node] pages. To prevent publication of these descendants, use the [`cascade`] front matter field to cascade [build options] to the descendant pages.

[build options]: /content-management/build-options/
[`cascade`]: /content-management/front-matter/#cascade-field
Expand Down
2 changes: 1 addition & 1 deletion content/en/methods/resource/Exif.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Applicable to JPEG and TIFF images, the `Exif` method on an image `Resource` obj
## Methods

Date
: (`time.Time`) Returns the image creation date/time. Format with the [`time.Format`]function.
: (`time.Time`) Returns the image creation date/time. Format with the [`time.Format`] function.

Lat
: (`float64`) Returns the GPS latitude in degrees.
Expand Down
4 changes: 2 additions & 2 deletions content/en/templates/embedded.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ Hugo's Open Graph template is configured using a mix of configuration variables
series = "series"
{{</ code-toggle >}}

{{< code-toggle file=content/blog/my-post.md >}}
{{< code-toggle file=content/blog/my-post.md fm=true >}}
title = "Post title"
description = "Text about this post"
date = "2006-01-02"
date = 2024-03-08T08:18:11-08:00
images = ["post-cover.png"]
audio = []
videos = []
Expand Down
6 changes: 3 additions & 3 deletions content/en/templates/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ In the example above the dot represents the `Page` object, and we call its [`Tit
[front matter]: /content-management/front-matter/
[`Title`]: /methods/page/title

The current context may change within a template. For example, at the top of a template the context might be a `Page` object, but we can rebind the context to another value or object within [`range`] or [`with`] blocks.
The current context may change within a template. For example, at the top of a template the context might be a `Page` object, but we rebind the context to another value or object within [`range`] or [`with`] blocks.

[`range`]: /functions/go-template/range/
[`with`]: /functions/go-template/with/
Expand Down Expand Up @@ -221,7 +221,7 @@ This is line two.`

## Variables

A variable is a user-defined [identifier] prefaced with a dollar sign (`$`), representing a value of any data type, initialized or assigned within a template action. For example, `$foo` and `$bar` are variables.
A variable is a user-defined [identifier] prepended with a dollar sign (`$`), representing a value of any data type, initialized or assigned within a template action. For example, `$foo` and `$bar` are variables.

[identifier]: /getting-started/glossary/#identifier

Expand Down Expand Up @@ -299,7 +299,7 @@ As shown above, frequently used functions have an alias. Use aliases in your tem
When calling a function, separate the arguments from the function, and from each other, with a space. For example:

```go-html-template
{{ $total := add 1 2 3 4 }} → 10
{{ $total := add 1 2 3 4 }}
```

## Methods
Expand Down
2 changes: 1 addition & 1 deletion content/en/templates/menu-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Call the partial above, passing a menu ID and the current page in context.

## Page references

Regardless of how you [define menu entries], an entry associated with a page has access to page variables and methods.
Regardless of how you [define menu entries], an entry associated with a page has access to page context.

This simplistic example renders a page parameter named `version` next to each entry's `name`. Code defensively using `with` or `if` to handle entries where (a) the entry points to an external resource, or (b) the `version` parameter is not defined.

Expand Down
10 changes: 8 additions & 2 deletions content/en/templates/output-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ outputs:

## List output formats

Each `Page` has both an `.OutputFormats` (all formats, including the current) and an `.AlternativeOutputFormats` variable, the latter of which is useful for creating a `link rel` list in your site's `<head>`:
Each `Page` object has both an [`OutputFormats`] method (all formats, including the current) and an [`AlternativeOutputFormats`] method, the latter of which is useful for creating a `link rel` list in your site's `<head>`:

[`OutputFormats`]: /methods/page/outputformats
[`AlternativeOutputFormats`]: /methods/page/alternativeoutputformats

```go-html-template
{{ range .AlternativeOutputFormats -}}
Expand All @@ -188,7 +191,10 @@ Each `Page` has both an `.OutputFormats` (all formats, including the current) an

## Link to output formats

The `Permalink` and `RelPermalink` methods on a `Page` object return the first output format defined for that page (usually `HTML` if nothing else is defined). This is regardless of the template from which they are called.
The [`Permalink`] and [`RelPermalink`] methods on a `Page` object return the first output format defined for that page (usually `HTML` if nothing else is defined). This is regardless of the template from which they are called.

[`Permalink`]: /methods/page/permalink
[`RelPermalink`]: /methods/page/relpermalink

__from `single.json.json`:__
```go-html-template
Expand Down
Loading

0 comments on commit 85ae97b

Please sign in to comment.