Add tests to assure that empty sections are supported

Ref: https://github.com/kaushalmodi/ox-hugo/issues/164
master
Kaushal Modi 8 years ago
parent 1afb24a8c8
commit 4d22bcda67
  1. 32
      test/site/content-org/all-posts.org
  2. 1
      test/site/content/articles/article-1.md
  3. 1
      test/site/content/articles/article-2.md
  4. 2
      test/site/content/posts/emacs-post-1.md
  5. 2
      test/site/content/posts/emacs-post-2.md
  6. 10
      test/site/content/root-level-content-empty-section.md
  7. 12
      test/site/content/root-level-content-section-set-to-slash.md
  8. 2
      test/site/content/zoo/post-in-zoo-section.md

@ -443,7 +443,7 @@ This post must not be exported as it is tagged =noexport=.
:EXPORT_FILE_NAME: commented-post
:END:
This post must not be exported as it is commented.
* Section
* Section :section:
** Articles
:PROPERTIES:
:EXPORT_HUGO_SECTION: articles
@ -489,7 +489,37 @@ Here is the second post on Emacs.
:EXPORT_HUGO_SECTION: zoo
:EXPORT_FILE_NAME: post-in-zoo-section
:END:
#+begin_description
Test where ~EXPORT_HUGO_SECTION~ is set in the post subtree itself.
#+end_description
This post will be created in the =zoo= section.
** Null HUGO_SECTION :root_level:
*** Using empty EXPORT_HUGO_SECTION
:PROPERTIES:
:EXPORT_HUGO_SECTION:
:EXPORT_FILE_NAME: root-level-content-empty-section
:END:
#+begin_description
Case where ~EXPORT_HUGO_SECTION~ is set to nothing.
#+end_description
{{{oxhugoissue(164)}}}
This post is created at the site root.
*** Setting EXPORT_HUGO_SECTION to "/"
:PROPERTIES:
:EXPORT_HUGO_SECTION: /
:EXPORT_FILE_NAME: root-level-content-section-set-to-slash
:END:
#+begin_description
Case where ~EXPORT_HUGO_SECTION~ is set to ~/~.
#+end_description
{{{oxhugoissue(164)}}}
This behaves the same as *not setting* ~EXPORT_HUGO_SECTION~ at all.
This post is created at the site root.
* Tables :table:
** Simple Table
:PROPERTIES:

@ -1,6 +1,7 @@
+++
title = "Article 1"
date = 2017-07-19T08:34:29-04:00
tags = ["section"]
draft = false
+++

@ -1,6 +1,7 @@
+++
title = "Article 2"
date = 2017-07-19T08:34:22-04:00
tags = ["section"]
draft = false
+++

@ -1,7 +1,7 @@
+++
title = "Emacs Post 1"
date = 2017-07-12T17:31:56-04:00
tags = ["emacs", "foo"]
tags = ["section", "emacs", "foo"]
draft = false
+++

@ -1,7 +1,7 @@
+++
title = "Emacs Post 2"
date = 2017-07-12T17:31:56-04:00
tags = ["emacs", "bar"]
tags = ["section", "emacs", "bar"]
draft = false
+++

@ -0,0 +1,10 @@
+++
title = "Using empty EXPORT_HUGO_SECTION"
description = "Case where `EXPORT_HUGO_SECTION` is set to nothing."
tags = ["section", "root-level"]
draft = false
+++
`ox-hugo` Issue #[164](https://github.com/kaushalmodi/ox-hugo/issues/164)
This post is created at the site root.

@ -0,0 +1,12 @@
+++
title = "Setting EXPORT_HUGO_SECTION to \"/\""
description = "Case where `EXPORT_HUGO_SECTION` is set to `/`."
tags = ["section", "root-level"]
draft = false
+++
`ox-hugo` Issue #[164](https://github.com/kaushalmodi/ox-hugo/issues/164)
This behaves the same as **not setting** `EXPORT_HUGO_SECTION` at all.
This post is created at the site root.

@ -1,5 +1,7 @@
+++
title = "HUGO_SECTION set in post subtree"
description = "Test where `EXPORT_HUGO_SECTION` is set in the post subtree itself."
tags = ["section"]
draft = false
+++

Loading…
Cancel
Save