mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 19:02:07 -05:00
parent
2638b04c62
commit
3697448450
1 changed files with 22 additions and 0 deletions
|
@ -70,6 +70,28 @@ It will create a new newsletter type of content file based on the archetype temp
|
|||
The above _newsletter type archetype_ illustrates the possibilities: The full Hugo `.Site` and all of Hugo's template funcs can be used in the archetype file.
|
||||
|
||||
|
||||
## Directory based archetypes
|
||||
|
||||
Since Hugo `0.49` you can use complete directories as archetype templates. Given this archetype directory:
|
||||
|
||||
```bash
|
||||
archetypes
|
||||
├── default.md
|
||||
└── post-bundle
|
||||
├── bio.md
|
||||
├── images
|
||||
│ └── featured.jpg
|
||||
└── index.md
|
||||
```
|
||||
|
||||
```bash
|
||||
hugo new --kind post-bundle post/my-post
|
||||
```
|
||||
|
||||
Will create a new folder in `/content/post/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.
|
||||
|
||||
|
||||
|
||||
[archetypes directory]: /getting-started/directory-structure/
|
||||
[content types]: /content-management/types/
|
||||
[front matter]: /content-management/front-matter/
|
||||
|
|
Loading…
Reference in a new issue