mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-17 05:23:44 +00:00
Minor copyediting, no new content added.
This commit is contained in:
parent
e3433e6afb
commit
68cea07072
3 changed files with 18 additions and 18 deletions
|
@ -25,7 +25,7 @@ and each section will use the corresponding type. If you are taking advantage of
|
||||||
this, then each new piece of content you place into a section will automatically
|
this, then each new piece of content you place into a section will automatically
|
||||||
inherit the type.
|
inherit the type.
|
||||||
|
|
||||||
Alternatively you can set the type in the meta data under the key "type".
|
Alternatively, you can set the type in the meta data under the key "`type`".
|
||||||
|
|
||||||
|
|
||||||
## Creating new content of a specific type
|
## Creating new content of a specific type
|
||||||
|
@ -53,24 +53,24 @@ whenever a specific file is not present.
|
||||||
*Remember, all of the following are optional:*
|
*Remember, all of the following are optional:*
|
||||||
|
|
||||||
### Create Type Directory
|
### Create Type Directory
|
||||||
Create a directory with the name of the type in layouts. Type is always singular. *Eg /layouts/post*.
|
Create a directory with the name of the type in `layouts`. Type is always singular. *E.g. `/layouts/post`*.
|
||||||
|
|
||||||
### Create single template
|
### Create single template
|
||||||
Create a file called single.html inside your directory. *Eg /layouts/post/single.html*.
|
Create a file called `single.html` inside your directory. *E.g. `/layouts/post/single.html`*.
|
||||||
|
|
||||||
### Create list template
|
### Create list template
|
||||||
Create a file called list.html inside your directory. *Eg /layouts/post/list.html*.
|
Create a file called `list.html` inside your directory. *E.g. `/layouts/post/list.html`*.
|
||||||
|
|
||||||
### Create views
|
### Create views
|
||||||
Many sites support rendering content in a few different ways, for
|
Many sites support rendering content in a few different ways, for instance,
|
||||||
instance a single page view and a summary view to be used when displaying a list
|
a single page view and a summary view to be used when displaying a list
|
||||||
of contents on a single page. Hugo makes no assumptions here about how you want
|
of contents on a single page. Hugo makes no assumptions here about how you want
|
||||||
to display your content, and will support as many different views of a content
|
to display your content, and will support as many different views of a content
|
||||||
type as your site requires. All that is required for these additional views is
|
type as your site requires. All that is required for these additional views is
|
||||||
that a template exists in each layout/type directory with the same name.
|
that a template exists in each layouts/`TYPE` directory with the same name.
|
||||||
|
|
||||||
### Create a corresponding archetype
|
### Create a corresponding archetype
|
||||||
|
|
||||||
Create a file called `type`.md in the /archetypes directory *Eg /archetypes/post.md*.
|
Create a file called <code><em>type</em>.md</code> in the `/archetypes` directory. *E.g. `/archetypes/post.md`*.
|
||||||
|
|
||||||
More details about archetypes can be found at the [archetypes docs](/content/archetypes)
|
More details about archetypes can be found at the [archetypes docs](/content/archetypes).
|
||||||
|
|
|
@ -80,9 +80,9 @@ Now, reference the partial template from your page template:
|
||||||
|
|
||||||
A few alternatives exist to [Disqus](http://disqus.com):
|
A few alternatives exist to [Disqus](http://disqus.com):
|
||||||
|
|
||||||
* [Intense Debate](http://intensedebate.com/)
|
* [IntenseDebate](http://intensedebate.com/)
|
||||||
* [LiveFyre](http://livefyre.com/)
|
* [Livefyre](http://livefyre.com/)
|
||||||
* [Moot](http://muut.com)
|
* [Muut](http://muut.com)
|
||||||
* [多说](http://duoshuo.com/) ([Duoshuo](http://duoshuo.com/), popular in China)
|
* [多说](http://duoshuo.com/) ([Duoshuo](http://duoshuo.com/), popular in China)
|
||||||
* [Kaiju](http://github.com/spf13/kaiju)
|
* [Kaiju](http://github.com/spf13/kaiju)
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,10 @@ different type of content to the content itself.
|
||||||
|
|
||||||
## Creating a content view
|
## Creating a content view
|
||||||
|
|
||||||
To create a new view simple create a template in each of your different
|
To create a new view, simple create a template in each of your different
|
||||||
content type directories with the view name. In the following example we
|
content type directories with the view name. In the following example, we
|
||||||
have created a "li" view and a "summary" view for our two content types
|
have created a "li" view and a "summary" view for our two content types
|
||||||
of post and project. As you can see these sit next to the [single
|
of post and project. As you can see, these sit next to the [single
|
||||||
content view](/templates/content) template "single.html". You can even
|
content view](/templates/content) template "single.html". You can even
|
||||||
provide a specific view for a given type and continue to use the
|
provide a specific view for a given type and continue to use the
|
||||||
\_default/single.html for the primary view.
|
\_default/single.html for the primary view.
|
||||||
|
@ -86,10 +86,10 @@ templates](/templates/list)).
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
In the above example you will notice that we have called .Render and passed in
|
In the above example, you will notice that we have called `.Render` and passed in
|
||||||
which view to render the content with. Render is a special function available on
|
which view to render the content with. `.Render` is a special function available on
|
||||||
a content which tells the content to render itself with the provided view template.
|
a content which tells the content to render itself with the provided view template.
|
||||||
In this example we are not using the li view. To use this we would
|
In this example, we are not using the li view. To use this we would
|
||||||
change the render line to `{{ .Render "li" }}`.
|
change the render line to `{{ .Render "li" }}`.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue