support modified date in website gen
2 files changed, 12 insertions(+), 4 deletions(-)

M src/website/makehtml.cpp
M src/website/md2json.cpp
M src/website/makehtml.cpp +6 -1
@@ 608,12 608,17 @@ void render_to_db(const char* url, const
 		auto abstract = write.str();
 
 		auto modified = link.get("modified").get(logical_url);
+		picojson::value created;
+		if (link.contains("created") && link.get("created").contains(logical_url)) {
+			created = link.get("created").get(logical_url);
+		}
 
 		picojson::object document{
 			{"content", content },
 			{"abstract", abstract },
 			{"url", logical_url },
-			{"modified", modified }
+			{"modified", modified },
+			{"created", created }
 		};
 
 		if (link.contains("markdown") && link.get("markdown").contains(p.first)) {

          
M src/website/md2json.cpp +6 -3
@@ 498,11 498,11 @@ int compile_page(const char *in, const c
 			struct stat inst;
 			stat(source.c_str(), &inst);
 
-			auto ltime = gmtime(&inst.st_mtime);
-
 			char buf[128];
-			strftime(buf, sizeof(buf), "%FT%TZ", ltime);
+			strftime(buf, sizeof(buf), "%FT%TZ", gmtime(&inst.st_mtime));
 			std::string isodate = buf;
+			strftime(buf, sizeof(buf), "%FT%TZ", gmtime(&inst.st_ctime));
+			std::string isodateCreate = buf;
 
 			std::stringstream md;
 			md << read.rdbuf();

          
@@ 567,6 567,9 @@ int compile_page(const char *in, const c
 				{ "modified", picojson::object {
 					{ basename, isodate }
 				}},
+				{ "created", picojson::object {
+					{ basename, isodateCreate }
+				} },
 				{ "~attachments", attach },
 			};