mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-28 17:22:38 +00:00
Update content management page order
This commit is contained in:
@@ -55,5 +55,5 @@ notes:
|
||||
|
||||
See what's coming next in the [Hugo roadmap][].
|
||||
|
||||
[Powerful Theming]: /themes
|
||||
[Hugo roadmap]: /about/roadmap
|
||||
[Powerful Theming]: /themes/
|
||||
[Hugo roadmap]: /about-hugo/roadmap
|
||||
@@ -26,7 +26,7 @@ in a language. I began developing Hugo in Go and fell in love with the
|
||||
language. I hope you will enjoy using Hugo (and [contributing to it][]) as much
|
||||
as I have writing it.
|
||||
|
||||
—Steve Francia ([@spf13][])
|
||||
―Steve Francia ([@spf13][])
|
||||
|
||||
[contributing to it]: https://github.com/spf13/hugo
|
||||
[Go language]: https://golang.org/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Content Management
|
||||
linktitle: Content Management
|
||||
title: "Introduction: Content Organization"
|
||||
linktitle: "Introduction"
|
||||
description: Content organization, summaries, archetypes, front matter, and supported formats.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
@@ -9,10 +9,6 @@ tags: [content, source, organization]
|
||||
categories: [content]
|
||||
weight: 01
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
aliases: [/content/]
|
||||
notes:
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,16 +7,18 @@ publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: [archetypes,generators]
|
||||
categories: [content]
|
||||
weight:
|
||||
weight: 50
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
notes:
|
||||
---
|
||||
|
||||
**Archetypes** are content (i.e., `.md`) files in the `archetypes` directory of your [project][] that contain pre-configured [front matter][] for your site's [content types][]. Archetypes facilitate more consistent metadata by enabling `hugo new` to populate new instances of a content type.
|
||||
|
||||
Hugo uses **archetypes** to facilitate creation of consistent metadata for content types across a website. Archetypes allow authors to easily generate new content files with associated metadata that are new instances of a content type. {{< relref "content-management/front-matter.md" >}}
|
||||
|
||||
To create new instances of a content type that pull from an archetype, authors can use the the `hugo new` command combined with the file path from the [content][] downward; e.g.---
|
||||
To create new instances of a content type that pull from an archetype, authors can use the the `hugo new` command combined with the file path that assumes the present directory is [content][] downward; e.g.---
|
||||
|
||||
```bash
|
||||
hugo new posts/my-first-post.md
|
||||
@@ -25,10 +27,7 @@ hugo new posts/my-first-post.md
|
||||
When defining a custom content type, you can use an **archetype** as a way to
|
||||
define the default metadata for a new post of that type.
|
||||
|
||||
**Archetypes** are quite literally archetypal content files with pre-configured
|
||||
[front matter][]. An archetype will populate each new content file of a given type with any default metadata you've defined whenever you run the `hugo new` command.
|
||||
|
||||
## Creating an archetype
|
||||
## Creating a Default Archetype
|
||||
|
||||
In the following example scenario, suppose we have a blog with a single content
|
||||
type (blog post). Our imaginary blog will use ‘tags’ and ‘categories’ for its
|
||||
@@ -48,7 +47,7 @@ categories = ["x", "y"]
|
||||
Some editors (e.g., Sublime, Emacs) do not insert an end-of-line (EOL) character at the end of the file (EOF). If you get a [strange EOF error](/troubleshooting/frequently-asked-questions/#eof-error) when using `hugo new`, open each archetype file and press <kbd>Enter</kbd> to type a carriage return after the closing `+++` or `---` if you're using TOML or YAML front matter, respectively.
|
||||
{{% /caution %}}
|
||||
|
||||
## Using the Archetype
|
||||
## Using the Default Archetype
|
||||
|
||||
Now, with `archetypes/default.md` in place, let's create a new post in the `post` section with the `hugo new` command:
|
||||
|
||||
@@ -76,6 +75,14 @@ We see that the `title` and `date` variables have been added in addition to the
|
||||
Congratulations! We have successfully created an archetype and used it to
|
||||
quickly scaffold out a new post. But wait, what if we want to create some content that isn't exactly a blog post, like a profile for a musician? Let's see how using **archetypes** can help us out.
|
||||
|
||||
### Override the Inferred Content Type in a New File
|
||||
|
||||
To override the content type for a new post, include the `--kind` flag during creation.
|
||||
|
||||
{{% note "Using a Theme Archetype" %}}
|
||||
If you wish to use archetypes that ship with a theme, the theme must be specified in your [configuration file](/project-organization/configuration/).
|
||||
{{% /note %}}
|
||||
|
||||
## Creating Custom Archetypes
|
||||
|
||||
Previously, we had created a new content type by adding a new subfolder to the content directory. In this case, its name would be `content/musician`. To begin using a `musician` archetype for each new `musician` post, we simply need to create a file named after the content type called `musician.md`, and put it in the `archetypes` directory, similar to the one below.
|
||||
@@ -146,17 +153,10 @@ Hugo CLI command:
|
||||
hugo new [my-content-type/post-name]
|
||||
```
|
||||
|
||||
### Override the Inferred Content Type in a New File
|
||||
|
||||
To override the content type for a new post, include the `--kind` flag during creation.
|
||||
|
||||
{{% note "Using Theme Archetypes" %}}
|
||||
If you wish to use archetypes that ship with a theme, the theme must be specified in your [configuration file](/project-organization/configuration/).
|
||||
{{% /note %}}
|
||||
|
||||
[`now()`]: http://golang.org/pkg/time/#Now
|
||||
[configuration file]: /project-organization/configuration/
|
||||
[content]: /project-organization/directory-structure/
|
||||
[front matter]: /content-management/front-matter/
|
||||
[project]:
|
||||
[RFC 3339 format]: https://www.ietf.org/rfc/rfc3339.txt
|
||||
|
||||
|
||||
+6
-4
@@ -1,14 +1,16 @@
|
||||
---
|
||||
title: Site Sections
|
||||
linktitle:
|
||||
title: Content Sections
|
||||
linktitle: Content Sections
|
||||
description:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
weight:
|
||||
weight: 30
|
||||
draft: false
|
||||
slug:
|
||||
aliases: [/content-management/sections,/content/sections/]
|
||||
notes:
|
||||
---
|
||||
---
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
tags: []
|
||||
categories: []
|
||||
weight:
|
||||
weight: 60
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
|
||||
@@ -7,7 +7,7 @@ publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: []
|
||||
weight:
|
||||
weight: 40
|
||||
draft: false
|
||||
slug:
|
||||
aliases: [/content/types]
|
||||
|
||||
@@ -7,7 +7,7 @@ publishdate: 2017-02-01
|
||||
lastmod: 2017-01-09
|
||||
categories: [content]
|
||||
tags: [cross references, anchors]
|
||||
weight:
|
||||
weight: 70
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
|
||||
@@ -7,7 +7,7 @@ publishdate: 2017-01-09
|
||||
lastmod: 2017-01-09
|
||||
categories: [content]
|
||||
tags: [front matter, yaml, toml, json, metadata]
|
||||
weight:
|
||||
weight: 20
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
|
||||
@@ -6,13 +6,24 @@ date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
tags: []
|
||||
weight:
|
||||
weight: 10
|
||||
draft: false
|
||||
slug:
|
||||
aliases: [/content/markdown-extras/,/content/supported-formats/]
|
||||
notes:
|
||||
---
|
||||
|
||||
## Markdown
|
||||
|
||||
Markdown is the natively supported content format for Hugo and is rendered using the excellent [BlackFriday project][].
|
||||
|
||||
{{% caution "Deeply Nested Lists" %}}
|
||||
Hugo uses [BlackFriday](https://github.com/russross/blackfriday), a markdown processor written in Go. A known issue [(#329)](https://github.com/russross/blackfriday/issues/329) in BlackFriday is the handling of deeply nested lists, but there is a workaround. If you write lists in markdown, be sure to include 4 spaces (i.e., <kbd>tab</kbd>) rather than 2 to delimit nesting of lists.
|
||||
{{% /caution %}}
|
||||
{{% /caution %}}
|
||||
|
||||
## Additional Resources
|
||||
|
||||
* [Markdown Tutorial][]
|
||||
|
||||
[BlackFriday project]: https://github.com/russross/blackfriday
|
||||
[Markdown Tutorial]: http://www.markdowntutorial.com/
|
||||
@@ -6,7 +6,7 @@ date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
tags: []
|
||||
weight:
|
||||
weight: 120
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Aliases/Redirects
|
||||
linktitle: Aliases/Redirects
|
||||
title: Permalinks and Redirects
|
||||
linktitle: Permalinks and Redirects
|
||||
description:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: [aliases,redirects]
|
||||
tags: [aliases,redirects,permalinks, url management,urls]
|
||||
categories: [content management]
|
||||
weight:
|
||||
weight: 80
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
title: Permalinks
|
||||
linktitle: Permalinks
|
||||
description:
|
||||
date: 2017-01-10
|
||||
publishdate: 2017-01-10
|
||||
lastmod: 2017-01-10
|
||||
tags: [permalinks,url,slug]
|
||||
weight:
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
notes:
|
||||
---
|
||||
@@ -7,7 +7,7 @@ publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: []
|
||||
weight:
|
||||
weight: 100
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
|
||||
@@ -7,7 +7,7 @@ publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
tags: []
|
||||
categories: []
|
||||
weight:
|
||||
weight: 90
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
|
||||
@@ -317,7 +317,7 @@ ignoreFiles = [ "\\.foo$", "\\.boo$" ]
|
||||
```
|
||||
The above is a list of regular expressions. Note that the backslash (`\`) character is escaped in this example to keep TOML happy.
|
||||
|
||||
## See Also
|
||||
## Additional Resources
|
||||
|
||||
* [TOML Spec][]
|
||||
* [YAML Spec][]
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
---
|
||||
title: Troubleshooting
|
||||
linktitle:
|
||||
description: FAQs pulled from the Hugo forum, known issues, and workarounds.
|
||||
title: Issues and FAQs
|
||||
linktitle: Issues and FAQs
|
||||
description: Frequently asked questions and known issues pulled from the Hugo Discuss forum.
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
layout: singlescroller
|
||||
weight: 01
|
||||
layout: sectionlist
|
||||
weight:
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
aliases: [/troubleshooting/faqs/,/faqs/]
|
||||
notes:
|
||||
---
|
||||
|
||||
|
||||
@@ -1,14 +1,2 @@
|
||||
---
|
||||
title:
|
||||
linktitle:
|
||||
description:
|
||||
date:
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
tags: []
|
||||
categories: []
|
||||
weight: 10
|
||||
draft: false
|
||||
slug:
|
||||
aliases: []
|
||||
---
|
||||
---
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
publishdate: Now()
|
||||
expirydate: ""
|
||||
description: ""
|
||||
tags: [tag1, tag2]
|
||||
categories: ['base category']
|
||||
---
|
||||
@@ -0,0 +1,2 @@
|
||||
{{ define "main" }}
|
||||
{{ end }}
|
||||
@@ -1,6 +1,12 @@
|
||||
{{ define "main" }}
|
||||
{{$title := .Title}}
|
||||
<main class="main">
|
||||
{{with .Params.testing }}
|
||||
{{range $ind,$value := . }}
|
||||
<p>Index: {{$ind}}</p>
|
||||
<p>Value: {{$value}}</p>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<header class="content-header">
|
||||
<h1 class="page-title">{{with .LinkTitle}}{{ . | markdownify}}{{else}}{{ .Title | markdownify }}{{end}}</h1>
|
||||
<div class="content-header-links">
|
||||
|
||||
@@ -20,7 +20,7 @@ aside {
|
||||
ul,
|
||||
ol {
|
||||
padding-left: .75em;
|
||||
margin-left: .25em;
|
||||
margin-left: .5em;
|
||||
margin-top: 0px;
|
||||
padding-top: 0px;
|
||||
margin-bottom: 1.5em;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user