Skip to content

Commit

Permalink
Markdown linting and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Jan 20, 2025
1 parent 2b9350c commit 51683a0
Show file tree
Hide file tree
Showing 86 changed files with 121 additions and 189 deletions.
4 changes: 2 additions & 2 deletions content/en/about/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ toc: true
[Mathematics]: /content-management/mathematics/
[Menus]: /content-management/menus/
[Minification]: /getting-started/configuration/#configure-minify
[Modules]: https://gohugo.io/hugo-modules/
[Modules]: /hugo-modules/
[Multilingual]: /content-management/multilingual/
[Multiplatform]: /installation/
[Output formats]: /templates/output-formats/
Expand All @@ -134,6 +134,6 @@ toc: true
[Syntax highlighting]: /content-management/syntax-highlighting/
[Tailwind CSS processing]: /functions/css/tailwindcss/
[Taxonomies]: /content-management/taxonomies/
[Templates]: templates/introduction/
[Templates]: /templates/introduction/
[Themes]: https://themes.gohugo.io/
[URL management]: /content-management/urls/
5 changes: 2 additions & 3 deletions content/en/content-management/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ publishResources = true
render = 'always'
{{< /code-toggle >}}


list
: When to include the page within page collections. Specify one of:

Expand Down Expand Up @@ -115,7 +114,7 @@ public/
In the example above, note that:

1. Hugo did not publish an HTML file for the page.
2. Despite setting `publishResources` to `false` in front matter, Hugo published the [page resources] because we invoked the [`RelPermalink`] method on each resource. This is the expected behavior.
1. Despite setting `publishResources` to `false` in front matter, Hugo published the [page resources] because we invoked the [`RelPermalink`] method on each resource. This is the expected behavior.

## Example -- headless section

Expand Down Expand Up @@ -181,7 +180,7 @@ public/
In the example above, note that:

1. Hugo did not publish an HTML file for the page.
2. Despite setting `publishResources` to `false` in front matter, Hugo correctly published the [page resources] because we invoked the [`RelPermalink`] method on each resource. This is the expected behavior.
1. Despite setting `publishResources` to `false` in front matter, Hugo correctly published the [page resources] because we invoked the [`RelPermalink`] method on each resource. This is the expected behavior.

## Example -- list without publishing

Expand Down
4 changes: 2 additions & 2 deletions content/en/content-management/content-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ toc: true

A content adapter is a template that dynamically creates pages when building a site. For example, use a content adapter to create pages from a remote data source such as JSON, TOML, YAML, or XML.

Unlike templates that reside in the `layouts` directory, content adapters reside in the `content` directory, no more than one per directory per language. When a content adapter creates a page, the page's [logical path](g)will be relative to the content adapter.
Unlike templates that reside in the `layouts` directory, content adapters reside in the `content` directory, no more than one per directory per language. When a content adapter creates a page, the page's [logical path](g) will be relative to the content adapter.

```text
content/
Expand Down Expand Up @@ -280,7 +280,7 @@ Step 4
With multilingual sites you can:

1. Create one content adapter for all languages using the [`EnableAllLanguages`](#enablealllanguages) method as described above.
2. Create content adapters unique to each language. See the examples below.
1. Create content adapters unique to each language. See the examples below.

### Translations by file name

Expand Down
3 changes: 1 addition & 2 deletions content/en/content-management/formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Hugo provides custom Markdown features including:
[Goldmark]: https://github.com/yuin/goldmark
[Markdown]: https://daringfireball.net/projects/markdown/
[Mathematics]: /content-management/mathematics/
[Render hooks]: https://gohugo.io/render-hooks/introduction/
[Render hooks]: /render-hooks/introduction/
[configure goldmark]: /getting-started/configuration-markup/#goldmark

### HTML
Expand Down Expand Up @@ -101,7 +101,6 @@ hugo --logLevel info
[configure the AsciiDoc renderer]: /getting-started/configuration-markup/#asciidoc
[configure asciidoc]: /getting-started/configuration-markup/#asciidoc


### Pandoc

Create your content in the [Pandoc] format preceded by front matter. Hugo renders Pandoc content to HTML using the Pandoc executable. You must install Pandoc to use the Pandoc content format.
Expand Down
7 changes: 3 additions & 4 deletions content/en/content-management/front-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ The field names below are reserved. For example, you cannot create a custom fiel

(`string`) The date associated with the page, typically the creation date. Note that the TOML format also supports unquoted date/time values. See the [dates](#dates) section for examples. Access this value from a template using the [`Date`] method on a `Page` object.


[`date`]: /methods/page/date/

###### description
Expand Down Expand Up @@ -144,7 +143,7 @@ lang

[`layout`]: /methods/page/layout/
[template lookup order]: /templates/lookup-order/
[target a specific template]: templates/lookup-order/#target-a-template
[target a specific template]: /templates/lookup-order/#target-a-template

###### linkTitle

Expand Down Expand Up @@ -442,5 +441,5 @@ When populating a date field, whether a [custom page parameter](#parameters) or
To override the default time zone, set the [`timeZone`](https://gohugo.io/getting-started/configuration/#timezone) in your site configuration. The order of precedence for determining the time zone is:

1. The time zone offset in the date/time string
2. The time zone specified in your site configuration
3. The `Etc/UTC` time zone
1. The time zone specified in your site configuration
1. The `Etc/UTC` time zone
7 changes: 3 additions & 4 deletions content/en/content-management/image-processing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,14 @@ If you change image processing methods or options, or if you rename or remove im
hugo --gc
```


[`anchor`]: /content-management/image-processing#anchor
[mounted]: /hugo-modules/configuration#module-configuration-mounts
[page bundle]: /content-management/page-bundles/
[`lang.FormatNumber`]: /functions/lang/formatnumber/
[filters]: /functions/images/filter/#image-filters
[github.com/disintegration/imaging]: <https://github.com/disintegration/imaging#image-resizing>
[Smartcrop]: <https://github.com/muesli/smartcrop#smartcrop>
[Exif]: <https://en.wikipedia.org/wiki/Exif>
[github.com/disintegration/imaging]: https://github.com/disintegration/imaging#image-resizing
[Smartcrop]: https://github.com/muesli/smartcrop#smartcrop
[Exif]: https://en.wikipedia.org/wiki/Exif
[`Process`]: #process
[`Colors`]: #colors
[`Crop`]: #crop
Expand Down
1 change: 0 additions & 1 deletion content/en/content-management/markdown-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ title = true # default is true
block = true # default is false
{{< /code-toggle >}}


## Standalone images

By default, when the [Goldmark] Markdown renderer encounters a standalone image element (no other elements or text on the same line), it wraps the image element within a paragraph element per the [CommonMark specification].
Expand Down
4 changes: 2 additions & 2 deletions content/en/content-management/menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ aliases: [/extras/menus/]
To create a menu for your site:

1. Define the menu entries
2. [Localize] each entry
3. Render the menu with a [template]
1. [Localize] each entry
1. Render the menu with a [template]

Create multiple menus, either flat or nested. For example, create a main menu for the header, and a separate menu for the footer.

Expand Down
10 changes: 4 additions & 6 deletions content/en/content-management/multilingual.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ This is the default language configuration:

In the above, `en` is the language key.


Language keys must conform to the syntax described in [RFC 5646]. For example:

- `en`
Expand Down Expand Up @@ -165,7 +164,6 @@ Note that you cannot disable the default content language.

### Configure multilingual multihost


Hugo supports multiple languages in a multihost configuration. This means you can configure a `baseURL` per `language`.

{{% note %}}
Expand Down Expand Up @@ -217,7 +215,7 @@ There are two ways to manage your content translations. Both ensure each page is
Considering the following example:

1. `/content/about.en.md`
2. `/content/about.fr.md`
1. `/content/about.fr.md`

The first file is assigned the English language and is linked to the second.
The second file is assigned the French language and is linked to the first.
Expand Down Expand Up @@ -251,7 +249,7 @@ The value of `contentDir` can be any valid path -- even absolute path references
Considering the following example in conjunction with the configuration above:

1. `/content/english/about.md`
2. `/content/french/about.md`
1. `/content/french/about.md`

The first file is assigned the English language and is linked to the second.
The second file is assigned the French language and is linked to the first.
Expand All @@ -267,8 +265,8 @@ Any pages sharing the same `translationKey` set in front matter will be linked a
Considering the following example:

1. `/content/about-us.en.md`
2. `/content/om.nn.md`
3. `/content/presentation/a-propos.fr.md`
1. `/content/om.nn.md`
1. `/content/presentation/a-propos.fr.md`

{{< code-toggle >}}
translationKey: "about"
Expand Down
1 change: 0 additions & 1 deletion content/en/content-management/urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ title ="Bar"
url = "/:sections[last]/:slug"
{{< /code-toggle >}}


## Site configuration

### Permalinks
Expand Down
2 changes: 1 addition & 1 deletion content/en/contribute/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For a complete guide to contributing to Hugo, see the [Contribution Guide].
[contributing]: CONTRIBUTING.md
[create a proposal]: https://github.com/gohugoio/hugo/issues/new?labels=Proposal%2C+NeedsTriage&template=feature_request.md
[documentation repository]: https://github.com/gohugoio/hugoDocs
[documentation]: https://gohugo.io/documentation
[documentation]: /documentation
[forum]: https://discourse.gohugo.io
[issue queue]: https://github.com/gohugoio/hugo/issues
[themes]: https://themes.gohugo.io/
Expand Down
2 changes: 1 addition & 1 deletion content/en/contribute/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Visit [themes.gohugo.io] to browse a collection of themes created by the Hugo co
To submit your theme:

1. Read the [submission guidelines]
2. Open a pull request in the [themes repository]
1. Open a pull request in the [themes repository]

Other useful theme directories:

Expand Down
2 changes: 1 addition & 1 deletion content/en/functions/collections/After.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The template above is rendered to:
You can use `after` in combination with the [`first`] function and Hugo's [powerful sorting methods](/quick-reference/page-collections/#sort). Let's assume you have a `section` page at `example.com/articles`. You have 10 articles, but you want your template to show only two rows:

1. The top row is titled "Featured" and shows only the most recently published article (i.e. by `publishdate` in the content files' front matter).
2. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.
1. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.

{{< code file=layouts/section/articles.html >}}
{{ define "main" }}
Expand Down
1 change: 0 additions & 1 deletion content/en/functions/collections/Dictionary.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ To create an empty map:
{{ $m := dict }}
```


Note that the `key` can be either a `string` or a `string slice`. The latter is useful to create a deeply nested structure, e.g.:

```go-html-template
Expand Down
4 changes: 2 additions & 2 deletions content/en/functions/collections/Where.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ Is rendered to:
To exclude a page with an undefined field from a boolean _inequality_ test:

1. Create a collection using a boolean comparison
2. Create a collection using a nil comparison
3. Subtract the second collection from the first collection using the [`collections.Complement`] function.
1. Create a collection using a nil comparison
1. Subtract the second collection from the first collection using the [`collections.Complement`] function.

[`collections.Complement`]: /functions/collections/complement/

Expand Down
1 change: 0 additions & 1 deletion content/en/functions/fmt/Warnf.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Use the [`warnidf`] function to allow optional suppression of specific warnings.

To prevent suppression of duplicate messages when using `warnf` for debugging, make each message unique with the [`math.Counter`] function. For example:


```go-html-template
{{ range site.RegularPages }}
{{ .Section | warnf "%#[2]v [%[1]d]" math.Counter }}
Expand Down
9 changes: 4 additions & 5 deletions content/en/functions/images/Dither.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@ This example uses the default dithering options.
Regardless of dithering method, do both of the following to obtain the best results:

1. Scale the image _before_ dithering
2. Output the image to a lossless format such as GIF or PNG
1. Output the image to a lossless format such as GIF or PNG

The example below does both of these, and it sets the dithering palette to the three most dominant colors in the image.


```go-html-template
{{ with resources.Get "original.jpg" }}
{{ $opts := dict
Expand Down Expand Up @@ -157,6 +156,6 @@ For best results, if the dithering palette is grayscale, convert the image to gr
The example above:

1. Resizes the image to be 800 px wide
2. Converts the image to grayscale
3. Dithers the image using the default (`FloydSteinberg`) dithering method with a grayscale palette
4. Converts the image to the PNG format
1. Converts the image to grayscale
1. Dithers the image using the default (`FloydSteinberg`) dithering method with a grayscale palette
1. Converts the image to the PNG format
1 change: 0 additions & 1 deletion content/en/functions/images/Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ hint

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


```go-html-template
{{ $filter := images.Process "webp" "icon" }}
{{ $filter := images.Process "crop 200x200 center r90 webp q50 icon" }}
Expand Down
20 changes: 6 additions & 14 deletions content/en/functions/js/Batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ The Batch `ID` is used to create the base directory for this batch. Forward slas
* [Config]
* [SetOptions]


## Group

The `Group` method take an `ID` (`string`) as argument. No slashes. It returns an object with these methods:


#### Script

The `Script` method takes an `ID` (`string`) as argument. No slashes. It returns an [OptionsSetter] that can be used to set [script options] for this script.
Expand Down Expand Up @@ -70,7 +68,6 @@ The `Instance` method takes two `string` arguments `SCRIPT_ID` and `INSTANCE_ID`

`SetOptions` takes a [params options] map. The instance options will be passed to any [runner] script in the same group, as JSON.


#### Runner

The `Runner` method takes an `ID` (`string`) as argument. No slashes. It returns an [OptionsSetter] that can be used to set [script options] for this runner.
Expand Down Expand Up @@ -129,7 +126,6 @@ The runner script's export must be a function that takes one argument, the group

Below is an example of a runner script that uses React to render elements. Note that the export (`default`) must match the `export` option in the [script options] (`default` is the default value for runner scripts) (runnable versions of examples on this page can be found at [js.Batch Demo Repo]):


```js
import * as ReactDOM from 'react-dom/client';
import * as React from 'react';
Expand All @@ -154,13 +150,11 @@ export default function Run(group) {
}
```



#### Config

Returns an [OptionsSetter] that can be used to set [build options] for the batch.

These are mostly the same as for [js.Build], but note that:
These are mostly the same as for `js.Build`, but note that:

* `targetPath` is set automatically (there may be multiple outputs).
* `format` must be `esm`, currently the only format supporting [code splitting].
Expand Down Expand Up @@ -283,7 +277,6 @@ See [this discussion](https://discourse.gohugo.io/t/js-batch-with-simple-global-
{{ end }}
```


## Known Issues

In the official documentation for [ESBuild's code splitting], there's a warning note in the header. The two issues are:
Expand All @@ -294,7 +287,7 @@ In the official documentation for [ESBuild's code splitting], there's a warning
We have not seen the ordering issue as a problem during our [extensive testing](https://github.com/bep/hugojsbatchdemo) of this new feature with different libraries. There are two main cases:

1. Undefined execution order of imports, see [this comment](https://github.com/evanw/esbuild/issues/399#issuecomment-1458680887)
2. Only one execution order of imports, see [this comment](https://github.com/evanw/esbuild/issues/399#issuecomment-735355932)
1. Only one execution order of imports, see [this comment](https://github.com/evanw/esbuild/issues/399#issuecomment-735355932)

Many would say that both of the above are [code smells](https://en.wikipedia.org/wiki/Code_smell). The first one has a simple workaround in Hugo. Define the import order in its own script and make sure it gets passed early to ESBuild, e.g. by putting it in a script group with a name that comes early in the alphabet.

Expand All @@ -307,7 +300,7 @@ console.log('entrypoints-workaround.js');
```

[build options]: #build-options
[`Resource`]: https://gohugo.io/methods/resource/
[`Resource`]: /methods/resource/
[`Resources`]: /methods/page/resources/
[`Resources.Mount`]: /methods/page/resources/#mount
[`templates.Defer`]: /functions/templates/defer/
Expand All @@ -319,13 +312,12 @@ console.log('entrypoints-workaround.js');
[instance]: #instance
[JavaScript import]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
[js.Batch Demo Repo]: https://github.com/bep/hugojsbatchdemo/
[js.Build]: https://gohugo.io/hugo-pipes/js/#options
[map]: https://gohugo.io/functions/collections/dictionary/
[map]: /functions/collections/dictionary/
[OptionsSetter]: #optionssetter
[page bundles]: https://gohugo.io/content-management/page-bundles/
[page bundles]: /content-management/page-bundles/
[params options]: #params-options
[runner]: #runner
[script options]: #script-options
[script]: #script
[SetOptions]: #optionssetter
[with]: https://gohugo.io/functions/go-template/with/
[with]: /functions/go-template/with/
1 change: 0 additions & 1 deletion content/en/functions/js/_common/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ sourceMap
sourcesContent {{< new-in 0.140.0 >}}
: (`bool`) Whether to include the content of the source files in the source map. By default, this is `true`.


JSX {{< new-in 0.124.0 >}}
: (`string`) How to handle/transform JSX syntax. One of: `transform`, `preserve`, `automatic`. Default is `transform`. Notably, the `automatic` transform was introduced in React 17+ and will cause the necessary JSX helper functions to be imported automatically. See https://esbuild.github.io/api/#jsx

Expand Down
1 change: 0 additions & 1 deletion content/en/functions/openapi3/Unmarshal.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ To list the GET and POST operations for each of the API paths:

Hugo renders this to:


```html
<p>/pets</p>
<dl>
Expand Down
1 change: 0 additions & 1 deletion content/en/functions/path/Join.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ See Go's [`path.Join`] and [`path.Clean`] documentation for details.
[`path.Clean`]: https://pkg.go.dev/path#Clean
[`path.Join`]: https://pkg.go.dev/path#Join


```go-html-template
{{ path.Join "partial" "news.html" }} → partial/news.html
{{ path.Join "partial/" "news.html" }} → partial/news.html
Expand Down
Loading

0 comments on commit 51683a0

Please sign in to comment.