Introduction
Welcome to this comprehensive guide on the Adding Pages feature in Empress. This feature is instrumental for developers as it allows you to add and customize pages in Empress. This guide will walk you through the process of implementing this feature along with its various functionalities.
Adding Pages
Adding pages in Empress is a straightforward process. By simply adding .html
or .md
files in the www
folder, you can create new pages. These pages should only contain the content and not the and
tags.
Adding pages in Empress:
<!-- Add your page content here -->
Markdown Pages
Empress also supports markdown. Pages can be written in markdown format for simplicity and ease of use.
Example of a markdown page:
# This is a title
This is some page content
a [link](/link/to/page)
Index
It’s important to note that the first file in a folder must be named index.md
or index.html
. Either of these files must be present for the system to recognize the folder as a valid location to build pages.
Adding Links
Links to pages can be provided without the .html
extension. For example, /home/link
can be used instead of /home/link.html
.
Page Title
The first <h1>
block, if present, will be used as the page title if not specified in a special tag. If no </h1><h1>
or title is specified, the file name will be used as the title.
Adding CSS
Customization is key in Empress. You can add a .css
file with the same filename as the .md
or .html
file (for instance, index.css
for index.md
). This file will be rendered with the page, allowing for customization of the page style.
Special Tags
Empress provides several special tags that offer more control over page rendering:
<!-- jinja -->
: Makes the page render in Jinja.<!-- title: Adding Pages -->
: Adds a custom title to the page.<!-- no-breadcrumbs -->
: Does not add breadcrumbs to the page.<!-- static -->
: Enables caching, particularly useful if you have used Jinja templating.
<!-- jinja -->
<!-- title: Adding Pages -->
<!-- no-breadcrumbs -->
<!-- static -->
In conclusion, the Adding Pages feature in Empress provides a versatile and developer-friendly way to expand and customize your project. By leveraging this feature, you can effectively manage and enhance your web pages, thereby contributing significantly to the development and customization of business solutions.