Skip to content

Commit 037cd60

Browse files
committed
Format file names, directory nanes, and file paths as code
Closes gohugoio#2767
1 parent d09a146 commit 037cd60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+168
-167
lines changed

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ MD046: false
2323
MD049: false
2424
MD050: false
2525
MD053: false
26+
MD055: false

archetypes/showcase/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ byline: "[bep](https://github.com/bep), Hugo Lead"
2020
To complete this showcase:
2121

2222
1. Write the story about your site in this file.
23-
2. Add a summary to the `bio.md` file in this folder.
23+
2. Add a summary to the `bio.md` file in this directory.
2424
3. Replace the `featured-template.png` with a screenshot of your site. You can rename it, but it must contain the word `featured`.
2525
4. Create a new pull request in https://github.com/gohugoio/hugoDocs/pulls
2626

content/en/content-management/archetypes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ hugo new content posts/my-first-post.md
5959

6060
The archetype lookup order is:
6161

62-
1. archetypes/posts.md
63-
1. archetypes/default.md
64-
1. themes/my-theme/archetypes/posts.md
65-
1. themes/my-theme/archetypes/default.md
62+
1. `archetypes/posts.md`
63+
1. `archetypes/default.md`
64+
1. `themes/my-theme/archetypes/posts.md`
65+
1. `themes/my-theme/archetypes/default.md`
6666

6767
If none of these exists, Hugo uses a built-in default archetype.
6868

content/en/content-management/content-adapters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ toc: true
1717

1818
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.
1919

20-
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] will be relative to the content adapter.
20+
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] will be relative to the content adapter.
2121

2222
```text
2323
content/
@@ -33,7 +33,7 @@ content/
3333
└── _index.md
3434
```
3535

36-
Each content adapter is named _content.gotmpl and uses the same [syntax] as templates in the layouts directory. You can use any of the [template functions] within a content adapter, as well as the methods described below.
36+
Each content adapter is named _content.gotmpl and uses the same [syntax] as templates in the `layouts` directory. You can use any of the [template functions] within a content adapter, as well as the methods described below.
3737

3838
## Methods
3939

content/en/content-management/cross-references.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The pages can be referenced as follows:
4949
{{</* relref "/blog/my-post.md" */>}}
5050
```
5151

52-
index.md can be reference either by its path or by its containing folder without the ending `/`. \_index.md can be referenced only by its containing folder:
52+
`index.md` can be reference either by its path or by its containing directory without the ending `/`. `_index.md` can be referenced only by its containing directory:
5353

5454
```text
5555
{{</* ref "/about" */>}} <-- References /about/_index.md

content/en/content-management/data-sources.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ Hugo can access and [unmarshal] local and remote data sources including CSV, JSO
1616

1717
[unmarshal]: /getting-started/glossary/#unmarshal
1818

19-
A data source might be a file in the data directory, a [global resource], a [page resource], or a [remote resource].
19+
A data source might be a file in the `data` directory, a [global resource], a [page resource], or a [remote resource].
2020

2121
[global resource]: /getting-started/glossary/#global-resource
2222
[page resource]: /getting-started/glossary/#page-resource
2323
[remote resource]: /getting-started/glossary/#remote-resource
2424

2525
## Data directory
2626

27-
The data directory in the root of your project may contain one or more data files, in either a flat or nested tree. Hugo merges the data files to create a single data structure, accessible with the `Data` method on a `Site` object.
27+
The `data` directory in the root of your project may contain one or more data files, in either a flat or nested tree. Hugo merges the data files to create a single data structure, accessible with the `Data` method on a `Site` object.
2828

29-
Hugo also merges data directories from themes and modules into this single data structure, where the data directory in the root of your project takes precedence.
29+
Hugo also merges data directories from themes and modules into this single data structure, where the `data` directory in the root of your project takes precedence.
3030

3131
{{% note %}}
3232
Hugo reads the combined data structure into memory and keeps it there for the entire build. For data that is infrequently accessed, use global or page resources instead.
@@ -42,7 +42,7 @@ project/
4242
```
4343

4444
{{% note %}}
45-
Do not place CSV files in the data directory. Access CSV files as page, global, or remote resources.
45+
Do not place CSV files in the `data` directory. Access CSV files as page, global, or remote resources.
4646
{{% /note %}}
4747

4848
See the documentation for the [`Data`] method on a `Site` object for details and examples.

content/en/content-management/image-processing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ To control tag availability, change the `excludeFields` or `includeFields` setti
482482

483483
## Smart cropping of images
484484

485-
By default, Hugo uses the [Smartcrop] library when cropping images with the `Crop` or`Fill` methods. You can set the anchor point manually, but in most cases the `Smart` option will make a good choice.
485+
By default, Hugo uses the [Smartcrop] library when cropping images with the `Crop` or `Fill` methods. You can set the anchor point manually, but in most cases the `Smart` option will make a good choice.
486486

487487
Examples using the sunset image from above:
488488

content/en/content-management/multilingual.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ defaultContentLanguageInSubdir
8080
: (`bool`) If `true`, Hugo renders the default language site in a subdirectory matching the `defaultContentLanguage`. Default is `false`.
8181

8282
contentDir
83-
: (`string`) The content directory for this language. Omit if [translating by file name].
83+
: (`string`) The `content` directory for this language. Omit if [translating by file name].
8484

8585
disabled
8686
: (`bool`) If `true`, Hugo will not render content for this language. Default is `false`.
@@ -232,7 +232,7 @@ If a file has no language code, it will be assigned the default language.
232232

233233
### Translation by content directory
234234

235-
This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` parameter.
235+
This system uses different content directories for each of the languages. Each language's `content` directory is set using the `contentDir` parameter.
236236

237237
{{< code-toggle file=hugo >}}
238238
languages:
@@ -256,9 +256,9 @@ Considering the following example in conjunction with the configuration above:
256256
The first file is assigned the English language and is linked to the second.
257257
The second file is assigned the French language and is linked to the first.
258258

259-
Their language is __assigned__ according to the content directory they are __placed__ in.
259+
Their language is __assigned__ according to the `content` directory they are __placed__ in.
260260

261-
By having the same **path and basename** (relative to their language content directory), the content pieces are __linked__ together as translated pages.
261+
By having the same **path and basename** (relative to their language `content` directory), the content pieces are __linked__ together as translated pages.
262262

263263
### Bypassing default linking
264264

content/en/content-management/page-bundles.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ leaf bundle
3333
: A _leaf bundle_ is a directory that contains an index.md file and zero or more resources. Analogous to a physical leaf, a leaf bundle is at the end of a branch. It has no descendants.
3434

3535
branch bundle
36-
: A _branch bundle_ is a directory that contains an _index.md file and zero or more resources. Analogous to a physical branch, a branch bundle may have descendants including leaf bundles and other branch bundles. Top level directories with or without _index.md files are also branch bundles. This includes the home page.
36+
: A _branch bundle_ is a directory that contains an `_index.md` file and zero or more resources. Analogous to a physical branch, a branch bundle may have descendants including leaf bundles and other branch bundles. Top level directories with or without `_index.md` files are also branch bundles. This includes the home page.
3737

3838
{{% note %}}
3939
In the definitions above and the examples below, the extension of the index file depends on the [content format]. For example, use index.md for Markdown content, index.html for HTML content, index.adoc for AsciiDoc content, etc.
@@ -47,10 +47,10 @@ Page bundle characteristics vary by bundle type.
4747

4848
| | Leaf bundle | Branch bundle |
4949
|---------------------|---------------------------------------------------------|---------------------------------------------------------|
50-
| Index file | index.md | _index.md |
51-
| Example | content/about/index.md | content/posts/_index.md |
50+
| Index file | `index.md` | `_index.md` |
51+
| Example | `content/about/index.md` | `content/posts/_index.md ` |
5252
| [Page kinds] | `page` | `home`, `section`, `taxonomy`, or `term` |
53-
| Template types | [single] | [home], [section], [taxonomy], or [term] |
53+
| Template types | [single] | [home], [section], [taxonomy], or [term] |
5454
| Descendant pages | None | Zero or more |
5555
| Resource location | Adjacent to the index file or in a nested subdirectory | Same as a leaf bundles, but excludes descendant bundles |
5656
| [Resource types] | `page`, `image`, `video`, etc. | all but `page` |
@@ -111,12 +111,12 @@ another-leaf-bundle
111111
: This leaf bundle does not contain any page resources.
112112

113113
{{% note %}}
114-
Create leaf bundles at any depth within the content directory, but a leaf bundle may not contain another bundle. Leaf bundles do not have descendants.
114+
Create leaf bundles at any depth within the `content` directory, but a leaf bundle may not contain another bundle. Leaf bundles do not have descendants.
115115
{{% /note %}}
116116

117117
## Branch bundles
118118

119-
A _branch bundle_ is a directory that contains an _index.md file and zero or more resources. Analogous to a physical branch, a branch bundle may have descendants including leaf bundles and other branch bundles. Top level directories with or without _index.md files are also branch bundles. This includes the home page.
119+
A _branch bundle_ is a directory that contains an `_index.md` file and zero or more resources. Analogous to a physical branch, a branch bundle may have descendants including leaf bundles and other branch bundles. Top level directories with or without `_index.md` files are also branch bundles. This includes the home page.
120120

121121
```text
122122
content/
@@ -145,7 +145,7 @@ branch-bundle-2
145145
: This branch bundle contains an index file and a leaf bundle.
146146

147147
{{% note %}}
148-
Create branch bundles at any depth within the content directory, but a leaf bundle may not contain another bundle. Leaf bundles do not have descendants.
148+
Create branch bundles at any depth within the `content` directory, but a leaf bundle may not contain another bundle. Leaf bundles do not have descendants.
149149
{{% /note %}}
150150

151151

content/en/content-management/related.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ weight = 80
8080
{{< /code-toggle >}}
8181

8282
* The `name` maps to a optional front matter slice attribute that can be used to link from the page level down to the fragment/heading level.
83-
* If `applyFilter`is enabled, the `.HeadingsFiltered` on each page in the result will reflect the filtered headings. This is useful if you want to show the headings in the related content listing:
83+
* If `applyFilter` is enabled, the `.HeadingsFiltered` on each page in the result will reflect the filtered headings. This is useful if you want to show the headings in the related content listing:
8484

8585
```go-html-template
8686
{{ $related := .Site.RegularPages.Related . | first 5 }}

0 commit comments

Comments
 (0)