-
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.
Add org-hugo-default-draft-state defcustom
- Break out draft state parsing to a separate function org-hugo--parse-draft-state. - Add tests for combinations of setting (and not setting) EXPORT_HUGO_DRAFT property and Org TODO states for drafting/undrafting a subtree post. Ref: #171
- Loading branch information
1 parent
50cddf5
commit 9fe197e
Showing
14 changed files
with
223 additions
and
38 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
+++ | ||
title = "Pre-Draft State" | ||
date = 2017-07-12T17:05:41-04:00 | ||
tags = ["draft"] | ||
draft = true | ||
+++ | ||
|
||
|
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,7 @@ | ||
+++ | ||
title = "HUGO_DRAFT false, DONE state" | ||
tags = ["draft", "todo", "done"] | ||
draft = false | ||
+++ | ||
|
||
The **DONE** state of Org TODO sets `draft` to `false` for this post. |
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,8 @@ | ||
+++ | ||
title = "HUGO_DRAFT false, DRAFT state (Override)" | ||
tags = ["draft", "todo", "override"] | ||
draft = true | ||
+++ | ||
|
||
This post has `EXPORT_HUGO_DRAFT` set to `"false"`. But the **DRAFT** | ||
state of Org TODO overrides that. |
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,8 @@ | ||
+++ | ||
title = "HUGO_DRAFT false, no TODO state" | ||
tags = ["draft", "property"] | ||
draft = false | ||
+++ | ||
|
||
This post does not have any Org TODO state. So it uses the value of | ||
`EXPORT_HUGO_DRAFT`. |
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 = "HUGO_DRAFT not set, DONE state" | ||
date = 2018-07-09T11:00:00+00:00 | ||
tags = ["draft", "todo", "done"] | ||
draft = false | ||
+++ | ||
|
||
This post is not marked as draft as the Org TODO state is set to | ||
`DONE`. |
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,7 @@ | ||
+++ | ||
title = "HUGO_DRAFT not set, DRAFT state" | ||
tags = ["draft", "todo"] | ||
draft = true | ||
+++ | ||
|
||
This post is marked as draft as the Org TODO state is set to `DRAFT`. |
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 = "HUGO_DRAFT not set, no TODO state either" | ||
tags = ["draft", "default"] | ||
draft = false | ||
+++ | ||
|
||
This post has neither the `EXPORT_HUGO_DRAFT` property set, nor the | ||
Org TODO state. So the draft state defaults to the value of | ||
`org-hugo-default-draft-state`. |
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 = "HUGO_DRAFT true, DONE state (Override)" | ||
date = 2018-07-09T10:38:00+00:00 | ||
tags = ["draft", "todo", "done", "override"] | ||
draft = false | ||
+++ | ||
|
||
This post has `EXPORT_HUGO_DRAFT` set to `"true"`. But the **DONE** | ||
state of Org TODO overrides that. |
13 changes: 13 additions & 0 deletions
13
test/site/content/posts/hugo-draft-true-todo-state-draft.md
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 = "HUGO_DRAFT true, DRAFT state" | ||
tags = ["draft", "todo"] | ||
draft = true | ||
+++ | ||
|
||
If a post has the Org TODO state set to `DRAFT`, the `draft` front | ||
matter variable should be set to `true` regardless of the value of | ||
`EXPORT_HUGO_DRAFT` property. | ||
|
||
Idea is to mark a post as `DRAFT` that you have already started | ||
writing, or are in the process at the moment, but it is not yet ready | ||
to be published |
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,8 @@ | ||
+++ | ||
title = "HUGO_DRAFT true, no TODO state" | ||
tags = ["draft", "property"] | ||
draft = true | ||
+++ | ||
|
||
This post does not have any Org TODO state. So it uses the value of | ||
`EXPORT_HUGO_DRAFT`. |