Efficient Website Creation with Empress with the `/www` Folder

Introduction

Welcome, developers! Today, we’re going to explore an integral part of Empress, a feature we call the /www Folder. This feature is the cornerstone of your website creation process, making it easy to create, modify, and structure your website’s pages. This guide will provide a deep dive into the technicalities of utilizing the /www folder effectively.

Understanding the /www Folder

The /www Folder is the central storage for all your website’s pages. The URLs of your website will correspond directly to the path of your pages within this folder. This structure makes it straightforward to manage and navigate your website’s architecture.

The /www folder accepts two types of files:

  • .html
  • .md (Markdown)

This versatility allows you to use either traditional HTML or the simpler Markdown language, depending on your needs and preferences.

Creating Pages within the /www Folder

Creating pages within the /www folder is as simple as adding .html or .md files. The name and path of the file within the folder will directly mirror the URL of the page on your website.

For example, a file saved as /www/about-us/index.html would be accessible through the URL www.yourwebsite.com/about-us.

Leveraging Empress’ Base HTML Template

To assist developers in creating web pages, Empress provides a basic HTML template in frappe/templates/base_template.html. This template serves as a starting point for your HTML pages, and you can modify it to fit the specific needs of your website.

To use the base template, copy its contents to your new .html file located in the /www folder and start customizing it.

Modifying and Debugging Pages

Modifying pages is as straightforward as editing the corresponding .html or .md files in the /www folder. Always remember to review and test your changes by accessing the URL that matches the file’s path.

For debugging purposes, standard HTML and Markdown debugging techniques apply. Since these files are server-rendered, any runtime errors will be visible on the server console.

Conclusions

The /www Folder is an essential feature in Empress, simplifying the process of website creation, modification, and management. Its structure allows for clear and efficient arrangement of your website’s pages, saving valuable time and reducing errors. By understanding and utilizing this feature, developers can create robust and customizable business solutions with ease.