requested URL. This is equivalent to Apache's DirectoryIndex option.
# See LICENSE file for copyright and license details.
# Python imports
# See LICENSE file for copyright and license details.
# Python imports
# CMless imports
import config, misc, template
# CMless imports
import config, misc, template
def main():
print("Content-Type: text/html;charset=utf-8\n")
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
+
content = misc.load_file(config.site_template_prefix + "/" + config.template_file)
content = template.page_title(content)
content = template.site_title(content)
content = misc.load_file(config.site_template_prefix + "/" + config.template_file)
content = template.page_title(content)
content = template.site_title(content)
# the CMless code.
site_data_prefix = "../site/data"
# the CMless code.
site_data_prefix = "../site/data"
+# Default page name. This specifies the filename to serve (if exists) when a
+# directory is specified as the REQUEST_URI. If is equivalent to Apache's
+# DirectoryIndex configuration option. No file extension is necessary as the
+# markup_file_extension configuration option handles that information.
+default_page = "index"
+
# The prefix to the website template relative to the bin/ folder which contains
# the CMless code.
site_template_prefix = "../site/template"
# The prefix to the website template relative to the bin/ folder which contains
# the CMless code.
site_template_prefix = "../site/template"