commit adf80219439497f5ecd5dfc386653861f6c20761
parent 26602ab197b23dd62677e88f90b10a58a5a6d5d5
Author: Hugo Soucy <hugo.soucy@equisoft.com>
Date: Sun, 20 Oct 2019 16:11:00 -0400
Provide minimal conf to avoid the needs of page's configuration file
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/ferron/utilities/file-utils.lua b/ferron/utilities/file-utils.lua
@@ -231,6 +231,12 @@ function fileutils.getpageconf(pagepath)
pageconf = require(fileutils.getplainname(conflua))
elseif confjson then
pageconf = json.decode(fileutils.pullfilecontent(confjson))
+ else
+ pageconf = {
+ title = fileutils.getplainname(pagepath):gsub('%W',' '):gsub("^%l", string.upper),
+ date = os.date('%Y-%m-%d', lfs.attributes(pagepath).modification),
+ datetime = os.date('%H:%M:%S', lfs.attributes(pagepath).modification),
+ }
end
return pageconf