Skip to content

Commit

Permalink
Add example on setting Hugo section in a parent subtree
Browse files Browse the repository at this point in the history
Closes #31

This feature was enabled by adding property inheritance support in
1a0d26c
  • Loading branch information
kaushalmodi committed Jul 19, 2017
1 parent 8068f34 commit c567f0c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
20 changes: 20 additions & 0 deletions example-site/content-org/all-posts.org
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,26 @@ Here the front matter format is set to YAML using the
=HUGO_FRONT_MATTER_FORMAT= key in property drawer.

Here there is white space in menu name property.
* Articles
:PROPERTIES:
:EXPORT_HUGO_SECTION: articles
:END:
** Article 1
:PROPERTIES:
:EXPORT_FILE_NAME: article-1
:END:
First article.

This will land in =content/articles/= as the parent of this subtree
sets =EXPORT_HUGO_SECTION= to =articles=. Note that the theme needs to
define at least the =single.html= for =articles/=.
** Article 2
:PROPERTIES:
:EXPORT_FILE_NAME: article-2
:END:
Second article.

This will also land in =content/articles/= the same way.
* TODO Pre-Draft State
:PROPERTIES:
:EXPORT_FILE_NAME: draft-state-todo
Expand Down
10 changes: 10 additions & 0 deletions example-site/content/articles/article-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
title = "Article 1"
date = 2017-07-19T08:34:29-04:00
tags = []
draft = false
+++

First article.

This will land in `content/articles/` as the parent of this subtree sets `EXPORT_HUGO_SECTION` to `articles`. Note that the theme needs to define at least the `single.html` for `articles/`.
10 changes: 10 additions & 0 deletions example-site/content/articles/article-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
title = "Article 2"
date = 2017-07-19T08:34:22-04:00
tags = []
draft = false
+++

Second article.

This will also land in `content/articles/` the same way.
8 changes: 8 additions & 0 deletions example-site/themes/bare_min/layouts/articles/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ define "main" }}

<div class="article">
<h1 class="article-title">{{ .Title }}</h1>
{{ .Content }}
</div>

{{ end }}

0 comments on commit c567f0c

Please sign in to comment.