X-Git-Url: http://git.subgeniuskitty.com/cmless/.git/blobdiff_plain/acd291ea49534cc4957148b0fc1594515ca57698..d955cfad358f87bc92b6f3cb2d1741e5dbb61cc5:/bin/template.py diff --git a/bin/template.py b/bin/template.py new file mode 100644 index 0000000..c5b1d19 --- /dev/null +++ b/bin/template.py @@ -0,0 +1,21 @@ +# (c) 2017 Aaron Taylor +# See LICENSE file for copyright and license details. + +# Python imports +import os + +# CMless imports +import config, misc + +def tpl_title(template): + keyword = "page_title" + return template.replace(config.template_delimiter + keyword + + config.template_delimiter, os.environ['REQUEST_URI']) + +def tpl_body(template): + keyword = "page_content" + body = misc.load_file(config.site_data_prefix + os.environ['REQUEST_URI'] + + config.markup_file_extension) + body = misc.process_markup(body) + return template.replace(config.template_delimiter + keyword + + config.template_delimiter, body)