Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow setting publishdate and expirydate also using Org time stamp
Now you can "C-c . RET" to set values for HUGO_PUBLISHDATE and HUGO_EXPIRYDATE properties too (just like you can already do that for DATE and HUGO_LASTMOD properties). Added test cases for "lastmod", "publishdate" and "expirydate" front-matter variables. Consolidate the date formatting logic into a separate new function `org-hugo--format-date', and use it to derive all the Hugo date front-matter variable values: "date", "lastmod", "publishdate", and "expirydate".
- Loading branch information
1 parent
aa0150d
commit 12dc593
Showing
8 changed files
with
188 additions
and
73 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,9 @@ | ||
+++ | ||
title = "Expiry date set using Hugo-compatible date string" | ||
expiryDate = 2999-01-23 | ||
tags = ["expiry-date"] | ||
draft = false | ||
+++ | ||
|
||
The `expirydate` for this post is Hugo-compatible | ||
i.e. [RFC3339-compliant](https://tools.ietf.org/html/rfc3339#section-5.8). |
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 = "Expiry date set using Org time stamp" | ||
expiryDate = 2999-01-23T00:00:00+00:00 | ||
tags = ["expiry-date"] | ||
draft = false | ||
+++ | ||
|
||
The `expirydate` for this post is set in Org using the `C-c . RET` | ||
binding. |
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 = "Lastmod date set using Hugo-compatible date string" | ||
lastmod = 2018-01-23 | ||
tags = ["lastmod-date"] | ||
draft = false | ||
+++ | ||
|
||
The `lastmod` for this post is Hugo-compatible i.e. [RFC3339-compliant](https://tools.ietf.org/html/rfc3339#section-5.8). |
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 = "Lastmod date set using Org time stamp" | ||
lastmod = 2018-01-23T00:00:00+00:00 | ||
tags = ["lastmod-date"] | ||
draft = false | ||
+++ | ||
|
||
The `lastmod` for this post is set in Org using the `C-c . RET` | ||
binding. |
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 = "Publish date set using Hugo-compatible date string" | ||
publishDate = 2018-01-23 | ||
tags = ["publish-date"] | ||
draft = false | ||
+++ | ||
|
||
The `publishdate` for this post is Hugo-compatible | ||
i.e. [RFC3339-compliant](https://tools.ietf.org/html/rfc3339#section-5.8). |
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 = "Publish date set using Org time stamp" | ||
publishDate = 2018-01-23T00:00:00+00:00 | ||
tags = ["publish-date"] | ||
draft = false | ||
+++ | ||
|
||
The `publishdate` for this post is set in Org using the `C-c . RET` | ||
binding. |