set_wrapper( function( page ) local this_directory = get_working_directory() local list = get_directory_items( this_directory ) local sorted_items = { file={}, directory={} } for i, item in ipairs( list ) do table.insert( sorted_items[ path_type( this_directory..item ) ], item ) end local directory_name = this_directory local back = [[← ]] if this_directory == "" then directory_name = "churchbasement.org" back = "" end -- out -- -- header -- local html = ("" ..[[ ]] -- body -- ..[[
]] ) -- navbar and file browser -- html = ( html ..[[
]] ..[[
]] ..back..[[🦋 ]]..directory_name..[[]] ..[[]] ..[[../
]].."\n" .."
\n" ) for i, directory in ipairs( sorted_items.directory ) do directory = directory.."/" html = ( html ..[[]] ..directory ..[[
]] ) end html = html.."
\n" local index_files = {} for i, file in ipairs( sorted_items.file ) do if file:sub(0, 5) == "index" then table.insert( index_files, file ) else html = html..[[]]..file..[[
]] end end html = html.."
\n" for i, file in ipairs( index_files ) do html = html..[[]]..file..[[
]] end html = ( html ..[[
]] ..[[
]] ) -- page -- html = html..page -- end body -- html = html..[[
]] return html end ) -------------------------------------- local shelf = require ( "shelf" ) return ( [[ ]] .. p [[aloooo! welcome to my site :3]] .. hr() .. br ( a [[music/]] ) ( a [[games/]] ) .. hr() .. br ( a [[about/]] ) .. hr() .. p [[🏳️]] [[]] [[]] [[]] [[⚧️]] )