|
@@ -703,15 +703,20 @@ M.generate_homepage = function()
|
|
|
end
|
|
|
|
|
|
|
|
|
-M.generate_site = function()
|
|
|
+M.reset_site = function()
|
|
|
-- Reset target folders.
|
|
|
-- TODO for larger sites, a selective update should be implemented by
|
|
|
-- comparing RDF resource timestamps with HTML page timestamps. Post-MVP.
|
|
|
if path.isdir(pkar.config.htmlgen.out_dir) then
|
|
|
- dir.rmtree(pkar.config.htmlgen.out_dir) end
|
|
|
+ logger:warn("Removing existing web site.")
|
|
|
+ dir.rmtree(pkar.config.htmlgen.out_dir)
|
|
|
+ end
|
|
|
|
|
|
-- Recreate asset dir.
|
|
|
- if path.isdir(M.asset_dir) then dir.rmtree(M.asset_dir) end
|
|
|
+ if path.isdir(M.asset_dir) then
|
|
|
+ logger:warn("Removing existing web assets.")
|
|
|
+ dir.rmtree(M.asset_dir)
|
|
|
+ end
|
|
|
dir.makepath(M.asset_dir)
|
|
|
|
|
|
-- Copy static assets.
|
|
@@ -719,6 +724,11 @@ M.generate_site = function()
|
|
|
datafile.path("templates/assets"),
|
|
|
M.asset_dir, dir.copyfile)
|
|
|
)
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+M.generate_site = function(keep)
|
|
|
+ if not keep then M.reset_site() end
|
|
|
|
|
|
-- Clear local search index keys.
|
|
|
idx_keys = {
|