.Kind (page): .Type (posts) / .Layout ()
Bundle: n/a (regular page)
[ categories | tags | search ]
ox-hugo Test Site

This is the test site for the ox-hugo package for Emacs/Org-mode.

It is updated automatically after each commit to the ox-hugo repo. It was last updated on Nov 30, 2022 23:38 UTC.


This page was created/modified in commit 03cf11b "Update the "Dates" tests" on 2018-01-23.
Markdown source of this page

Invalid Date

tags: dates date invalid


Description/Summary

It’s possible that someone is using an existing Org file to export to Hugo. Some exporters like ox-texinfo recognize dates of style YEAR1-YEAR2 to use them in Copyright headers. But that date is invalid as per the standard date format used by Hugo in date front-matter, and also as per org-parse-time-string. So in that case, don’t allow org-parse-time-string to throw an error and abort the export, but instead simply don’t set the date in the front-matter.


Content

It’s possible that someone is using an existing Org file to export to Hugo. Some exporters like ox-texinfo recognize dates of style YEAR1-YEAR2 to use them in Copyright headers.

But that date is invalid as per the standard date format used by Hugo in date front-matter, and also as per org-parse-time-string.

So in that case, don’t allow org-parse-time-string to throw an error and abort the export, but instead simply don’t set the date in the front-matter.

In this post the :EXPORT_DATE: property is set to 2012-2017, but the export will still happen fine, with the date front-matter not set.


Page (Debug)

Page VariableValue
Name "Invalid Date"
Title "Invalid Date"
ResourceType "page"
Kind "page"
Section "posts"
Draft false
Type "posts"
Layout ""
Permalink "https://ox-hugo.scripter.co/test/posts/invalid-date/"
RelPermalink "/posts/invalid-date/"
Data
page.Data{} (type:page.Data)
NextPageInlined SVG
PrevPageInvalid Nocites
NextInSectionInlined SVG
PrevInSectionInvalid Nocites

Page Params (Debug)

KeyTypeValue
draftbool false
iscjklanguagebool false
lastmodtime.Time 2018-01-23 14:19:10 -0500 -0500
tags[]string "dates" "date" "invalid"
titlestring "Invalid Date"

File Object (Debug)

FileInfo VariableValue
UniqueID "cd4a1c1940a776978bf41c3a76d02af2"
BaseFileName "invalid-date"
TranslationBaseName "invalid-date"
Lang "en"
Section "posts"
LogicalName "invalid-date.md"
Dir "posts/"
Ext "md"
Path "posts/invalid-date.md"

This site is generated using the ox-hugo package for Emacs/Org-mode + hugo-bare-min-theme + Hugo 0.101.0 (commit 466fa43c16709b4483689930a4f9ac8add5c9f66) . This site is powered by Netlify.
[Test Site home | ox-hugo home]