1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 10:18:21 +01:00
antd-web-apps/doc/views/default/index/search.ls
DanyLE a76942f2f3
All checks were successful
gitea-sync/antd-web-apps/pipeline/head This commit looks good
WIP: make code compatible with new SILK API
2023-04-26 18:51:03 +02:00

26 lines
864 B
Plaintext

<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)
title = ulib.trim(ulib.trim(title, "#"), " ")
echo("<div>")
echo("<p class= 'result-header'><a href='"..HTTP_ROOT..'/'..controller..'/'..enc.b64encode(file):gsub("=","")..'/'..title:gsub(" ", "_")..".md'>")
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>