diff options
-rw-r--r-- | doc/lua-filters.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 1862700c9..1cdad7391 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -362,12 +362,14 @@ end ## Setting the date in the metadata This filter sets the date in the document's metadata to the -current date: +current date, if a date isn't already set: ``` lua function Meta(m) - m.date = os.date("%B %e, %Y") - return m + if m.date == nil then + m.date = os.date("%B %e, %Y") + return m + end end ``` |