Skip to content

@metaphox /convert.lua
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
function entry(metadata)
local postname = '_posts/' .. metadata.ref .. '.lua'
local pubdate = os.date("*t", metadata.pubdate)
print('Processing ' .. postname)
local convertedname = '_posts/' .. pubdate.year .. '-'
.. pubdate.month .. '-'
.. pubdate.day .. '-'
.. metadata.ref .. '.html'
print('Converting file into ' .. convertedname)
local f = assert(io.open(convertedname, 'w'))
function blogentry(entry)
io.output(f)
io.write('---\n')
io.write('title: ', entry.title, '\n')
io.write('layout: post\n')
io.write('---\n')
io.write(entry.text)
end
dofile(postname)
f:close()
end
function convert(file_name)
dofile(file_name)
end
convert('blogmeta.lua')
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.