shithub: hugo

Download patch

ref: d584ca59f03730431b71f6d1fa9620f7f7fc84fb
parent: 16cbda979c4aaa188ea27f5f74a3cf8e4a4b092c
author: digitalcraftsman <[email protected]>
date: Mon Aug 24 09:29:45 EDT 2015

Describe the use of custom archetypes in the docs

--- a/docs/content/content/archetypes.md
+++ b/docs/content/content/archetypes.md
@@ -56,8 +56,35 @@
 
 We see that the `title` and `date` variables have been added, in addition to the `tags` and `categories` variables which were carried over from `archetype/default.md`.
 
-Congratulations!  We have successfully created an archetype and used it for our new contents.  That's all there is to it!
+Congratulations!  We have successfully created an archetype and used it for our new contents. But wait, what if I want to have different variables for another content type, like musicians? No problem.
 
+### Creating custom archetypes
+
+Earlier you created a new content type by adding a new subfolder to the content directory. In our case it's name would be `content/musician`. To use the corresponding archetype you just need to create a file named after the content type called `musician.md` in the `archetypes` directory, similar to the one below.
+
+#### archetypes/musician.md
+
+    +++
+    name = ""
+    bio = ""
+    genre = ""
+    +++
+
+Now let's create a new musician.
+
+    $ hugo new musician/mozart.md
+
+This time, Hugo recognizes the custom archetype and uses it instead of the default one. So the generated file's frontmatter now includes the variables `name`, `bio` and `genre`.
+
+#### content/musician/mozart.md
+
+    +++
+    title = "mozart"
+    date = "2015-08-24T13:04:37+02:00"
+    name = ""
+    bio = ""
+    genre = ""
+    +++
 
 ## Using a different front matter format