-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary org-export-data forms
Add tests for type, layout, url, slug, linktitle and markup front-matter. Fixes #52
- Loading branch information
1 parent
d62d38d
commit 79616a3
Showing
12 changed files
with
199 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
+++ | ||
title = "Layout Front-matter" | ||
layout = "alternate-single" | ||
tags = ["front-matter", "layout"] | ||
draft = false | ||
+++ | ||
|
||
The `layout` front-matter is used to override the default **single** | ||
layout of a regular page. See [Template Lookup Order](https://gohugo.io/templates/lookup-order/) to learn more. | ||
|
||
Here the layout is overridden to be `alternate-single`. | ||
|
||
[Reference](https://gohugo.io/content-management/front-matter/#predefined) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+++ | ||
title = "Linktitle Front-matter" | ||
linkTitle = "My link title" | ||
tags = ["front-matter", "linktitle"] | ||
draft = false | ||
+++ | ||
|
||
The `linktitle` front-matter is used for creating links to content. If | ||
set, Hugo defaults to using the `linktitle` before the `title`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+++ | ||
title = "Markup Front-matter" | ||
markup = "org" | ||
tags = ["front-matter", "markup"] | ||
draft = false | ||
+++ | ||
|
||
The markup for this post is set to `org`. So the Markdown markup based | ||
emphasis **won't work** here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
+++ | ||
title = "Slug Front-matter" | ||
slug = "this-is-how-i-want-to-name-this-link" | ||
tags = ["front-matter", "slug"] | ||
draft = false | ||
+++ | ||
|
||
By default, a page's _slug_ is the name of the content file (sans | ||
extension). So in this case, it would have been | ||
`slug-front-matter`. But that slug is overridden using the specified | ||
`slug` in the front-matter: `this-is-how-i-want-to-name-this-link`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
+++ | ||
title = "Type + Layout Front-matter" | ||
layout = "alternate-single" | ||
tags = ["front-matter", "type", "layout"] | ||
type = "type-test" | ||
draft = false | ||
+++ | ||
|
||
Here both `type` **and** `layout` are overridden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
+++ | ||
title = "Type Front-matter" | ||
tags = ["front-matter", "type"] | ||
type = "type-test" | ||
draft = false | ||
+++ | ||
|
||
The `type` front-matter is used to override the default **section** type | ||
(automatically derived from the directory of the content page). | ||
|
||
Here the type is overridden to be `type-test`. | ||
|
||
[Reference](https://gohugo.io/content-management/front-matter/#predefined) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
+++ | ||
title = "URL Front-matter" | ||
tags = ["front-matter", "url"] | ||
url = "foo/bar/zoo/url-front-matter" | ||
draft = false | ||
+++ | ||
|
||
The `url` front-matter is used to specify **the full path to the | ||
content from the web root**. It makes no assumptions about the path of | ||
the content file. It also ignores any language prefixes of the | ||
multilingual feature. | ||
|
||
[Reference](https://gohugo.io/content-management/front-matter/#predefined) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{ define "main" }} | ||
|
||
{{ "**This is `alternate-single` layout from `_default`.**" | markdownify }} | ||
|
||
<hr> | ||
{{ .Content }} | ||
|
||
<hr> | ||
<a id="debug"></a> | ||
<h3 id="page-debug">Page Params (Debug)</h3> | ||
{{ partial "debugprint.html" .Params }} | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{ define "main" }} | ||
|
||
{{ "**This is `alternate-single` layout from type `type-test`.**" | markdownify }} | ||
|
||
<hr> | ||
{{ .Content }} | ||
|
||
<hr> | ||
<a id="debug"></a> | ||
<h3 id="page-debug">Page Params (Debug)</h3> | ||
{{ partial "debugprint.html" .Params }} | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{ define "main" }} | ||
|
||
{{ "**This is `single` layout of type `type-test`.**" | markdownify }} | ||
|
||
<hr> | ||
{{ .Content }} | ||
|
||
<hr> | ||
<a id="debug"></a> | ||
<h3 id="page-debug">Page Params (Debug)</h3> | ||
{{ partial "debugprint.html" .Params }} | ||
|
||
{{ end }} |