X-Git-Url: http://git.subgeniuskitty.com/cmless/.git/blobdiff_plain/990c6f795837b53044174097e643466a19d6c232..bc9c2a94fc68775e98d9bb3087c4d32cb2d112df:/bin/cmless.py diff --git a/bin/cmless.py b/bin/cmless.py index 84d5b69..500edb6 100755 --- a/bin/cmless.py +++ b/bin/cmless.py @@ -4,7 +4,7 @@ # See LICENSE file for copyright and license details. # Python imports -import sys +import sys, os, urllib.parse # CMless imports import config, misc, template @@ -12,10 +12,16 @@ import config, misc, template def main(): print("Content-Type: text/html;charset=utf-8\n") + if os.environ['REQUEST_URI'][-1] == "/": + os.environ['REQUEST_URI'] = os.environ['REQUEST_URI'] + config.default_page + os.environ['REQUEST_URI'] = urllib.parse.unquote(os.environ['REQUEST_URI']) + content = misc.load_file(config.site_template_prefix + "/" + config.template_file) content = template.page_title(content) content = template.site_title(content) content = template.current_year(content) + content = template.head_meta_description(content) + content = template.head_meta_keywords(content) content = template.body(content) print(content)