# # Pages for the home server. # import os import logging from easydict import EasyDict as edict import quart import util import asfquart APP = asfquart.APP _LOGGER = logging.getLogger(__name__) @APP.get('/') @APP.use_template('templates/homepage.ezt') async def homepage(): links = [ edict(**link) for link in APP.cfg.links ] data = edict( message='message goes here', user='gstein', title='Home Page', leftnav=util.build_active_leftnav('home'), links=links, ) return data @APP.get('/favicon.ico') async def favicon(): ### set ETag and cache values? return await quart.send_from_directory(util.STATIC_DIR, 'favicon.ico') @APP.get('//') async def static_content(subdir, fname): dname = os.path.join(util.STATIC_DIR, subdir) ### set ETag and cache values. Especially for the bootstrap files ### to deal with upgrades. meh? versioned in the name. return await quart.send_from_directory(dname, fname)