2020-06-24 19:00:41 +02:00
|
|
|
<div class = "md-content">
|
|
|
|
<?lua
|
|
|
|
if data then
|
|
|
|
for file,arr in pairs(data) do
|
|
|
|
local f = io.open(file, "r")
|
|
|
|
io.input(f)
|
|
|
|
local title = io.read()
|
|
|
|
io.close()
|
|
|
|
file = file:gsub(map.local_path, map.vfs_path)
|
2023-04-26 18:51:03 +02:00
|
|
|
title = ulib.trim(ulib.trim(title, "#"), " ")
|
2020-06-24 19:00:41 +02:00
|
|
|
echo("<div>")
|
2023-04-26 18:51:03 +02:00
|
|
|
echo("<p class= 'result-header'><a href='"..HTTP_ROOT..'/'..controller..'/'..enc.b64encode(file):gsub("=","")..'/'..title:gsub(" ", "_")..".md'>")
|
2020-06-24 19:00:41 +02:00
|
|
|
echo(title)
|
|
|
|
echo("</a></p>")
|
|
|
|
for i,content in ipairs(arr) do
|
|
|
|
echo("<p class= 'result-content'>")
|
|
|
|
echo("..."..content.."...")
|
|
|
|
echo("</p>")
|
|
|
|
end
|
|
|
|
echo("</div>")
|
|
|
|
end
|
|
|
|
else
|
|
|
|
echo("<p>No search result found</p>")
|
|
|
|
end
|
|
|
|
?>
|
|
|
|
</div>
|