Skip to content

Commit

Permalink
Use "hugo new content" to create content
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Aug 18, 2023
1 parent 673846f commit a70f200
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions content/en/content-management/archetypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ aliases: [/content/archetypes/]

## What are archetypes?

**Archetypes** are content template files in the [archetypes directory] of your project that contain preconfigured [front matter] and possibly also a content disposition for your website's [content types]. These will be used when you run `hugo new`.
**Archetypes** are content template files in the [archetypes directory] of your project that contain preconfigured [front matter] and possibly also a content disposition for your website's [content types]. These will be used when you run `hugo new content`.


The `hugo new` uses the `content-section` to find the most suitable archetype template in your project. If your project does not contain any archetype files, it will also look in the theme.
The `hugo new content` command uses the `content-section` to find the most suitable archetype template in your project. If your project does not contain any archetypes, it will also look in the theme.

{{< code file="archetype-example.sh" >}}
hugo new posts/my-first-post.md
{{< /code >}}
```text
hugo new content posts/my-first-post.md
```

The above will create a new content file in `content/posts/my-first-post.md` using the first archetype file found of these:

Expand Down Expand Up @@ -56,7 +56,7 @@ draft: true
When you create a new newsletter with:

```bash
hugo new newsletter/the-latest-cool.stuff.md
hugo new content newsletter/the-latest-cool.stuff.md
```

It will create a new newsletter type of content file based on the archetype template.
Expand All @@ -80,7 +80,7 @@ archetypes
```

```bash
hugo new --kind post-bundle posts/my-post
hugo new content --kind post-bundle posts/my-post
```

Will create a new folder in `/content/posts/my-post` with the same set of files as in the `post-bundle` archetypes folder. All content files (`index.md` etc.) can contain template logic, and will receive the correct `.Site` for the content's language.
Expand Down
10 changes: 5 additions & 5 deletions content/en/content-management/multilingual.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,20 +641,20 @@ To support Multilingual mode in your themes, some considerations must be taken f
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).


## Generate multilingual content with `hugo new`
## Generate multilingual content with `hugo new content`

If you organize content with translations in the same directory:

```text
hugo new post/test.en.md
hugo new post/test.de.md
hugo new content post/test.en.md
hugo new content post/test.de.md
```

If you organize content with translations in different directories:

```text
hugo new content/en/post/test.md
hugo new content/de/post/test.md
hugo new content content/en/post/test.md
hugo new content content/de/post/test.md
```

[abslangurl]: /functions/abslangurl
Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/directory-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ example/
The following is a high-level overview of each of the directories with links to each of their respective sections within the Hugo docs.

[`archetypes`](/content-management/archetypes/)
: You can create new content files in Hugo using the `hugo new` command.
: You can create new content files in Hugo using the `hugo new content` command.
By default, Hugo will create new content files with at least `date`, `title` (inferred from the file name), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes] with custom preconfigured front matter fields as well.

[`assets`]
Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Press `Ctrl + C` to stop Hugo's development server.
Add a new page to your site.

```text
hugo new posts/my-first-post.md
hugo new content posts/my-first-post.md
```

Hugo created the file in the `content/posts` directory. Open the file with your editor.
Expand Down
2 changes: 1 addition & 1 deletion content/en/showcase/template/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Have a **notable Hugo site[^1]**? We would love to feature it in this **Showcase
Please:

1. Fork https://github.com/gohugoio/hugoDocs.
2. Run `hugo new showcase/your-site`. This will use the archetype bundle in the [docs repo](https://github.com/gohugoio/hugoDocs/tree/master/archetypes).
2. Run `hugo new content showcase/your-site`. This will use the archetype bundle in the [docs repo](https://github.com/gohugoio/hugoDocs/tree/master/archetypes).
3. Follow the instructions in the newly created page bundle.
4. Create a new pull request in https://github.com/gohugoio/hugoDocs/pulls.

Expand Down

0 comments on commit a70f200

Please sign in to comment.