Destination name creation changes

Mon, 06 Jul 2020 12:35:23 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 06 Jul 2020 12:35:23 -0500
changeset 25
11ae9103f59d
parent 24
4013d2901832
child 26
77cd7b8fb6a6

Destination name creation changes

handlers/render.lua file | annotate | diff | comparison | revisions
--- a/handlers/render.lua	Mon Jul 06 12:35:04 2020 -0500
+++ b/handlers/render.lua	Mon Jul 06 12:35:23 2020 -0500
@@ -56,7 +56,13 @@
     if meta.destination then
         destination=path.join(path.dirname(file), meta.destination)
     else
+        -- If the file has two extensions, then only remove last extension.
+        -- Otherwise replace extension with .html.
         destination=path.rmext(file)
+        base=path.rmext(destination)
+        if base==destination then
+            destination = destination .. ".html"
+        end
     end
 
     local page={

mercurial