Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e74d70af1b | |||
| fcc6ef114a |
@@ -109,14 +109,13 @@ end
|
|||||||
|
|
||||||
-- get index.html content
|
-- get index.html content
|
||||||
local indexFile = io.open("index.html"):read("*all")
|
local indexFile = io.open("index.html"):read("*all")
|
||||||
local siteName
|
|
||||||
local siteTitle
|
|
||||||
|
|
||||||
-- remove and create "public/" directory
|
-- remove and create "public/" directory
|
||||||
lfs.rmdir("public")
|
lfs.rmdir("public")
|
||||||
lfs.mkdir("public")
|
lfs.mkdir("public")
|
||||||
|
|
||||||
for index, _ in ipairs(markdownFiles) do
|
for index, _ in ipairs(markdownFiles) do
|
||||||
|
if markdownFiles[index].options["draft"] ~= "yes" then
|
||||||
local workDir = lfs.currentdir()
|
local workDir = lfs.currentdir()
|
||||||
-- create html file for that md file
|
-- create html file for that md file
|
||||||
local htmlFile = io.open(workDir .. "/public/" .. markdownFiles[index].fileName .. ".html", 'w')
|
local htmlFile = io.open(workDir .. "/public/" .. markdownFiles[index].fileName .. ".html", 'w')
|
||||||
@@ -239,7 +238,6 @@ for index, _ in ipairs(markdownFiles) do
|
|||||||
s = s:gsub("`(.-)`", "<code>%1</code>")
|
s = s:gsub("`(.-)`", "<code>%1</code>")
|
||||||
-- horizontal rule
|
-- horizontal rule
|
||||||
s = s:gsub("%-%-%-", "<hr>")
|
s = s:gsub("%-%-%-", "<hr>")
|
||||||
-- TODO: p for normal text
|
|
||||||
|
|
||||||
return s
|
return s
|
||||||
end
|
end
|
||||||
@@ -267,4 +265,4 @@ for index, _ in ipairs(markdownFiles) do
|
|||||||
print("Error: Cannot create html file for " .. markdownFiles[index].filePath)
|
print("Error: Cannot create html file for " .. markdownFiles[index].filePath)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user