LSTE (Laura's Simple Template Engine) is a minimalist static site generator designed to help you quickly create and manage small websites with ease. LSTE allows you to build a complete website by combining template parts, assets, and content, all while keeping the process straightforward and lightweight.
- See
/example-simple
for a simple website template - See
/example-full
for a website template which uses several plugins (which basically is my blog)
Make sure you have python3 and python3-markdown installed.
- Clone this repository
- execute
./lste.py --path=./example-simple
to generate a website into./example-simple/dist
# NAME
# Lauras Simple Template Enginge - LSTE
#
# SYNOPSIS
# ./lste.py [--watch] [--path]
#
# DESCRIPTION
# This script generates a website to ./dist out of the given template
# parts, the assets and the content itself
#
# EXAMPLE:
# ./lste.py --path=./website-src
#
# OPTIONS
# -p|--path Sets the base directory for the website. If not setted
# LSTE uses the current active directory
# -w|--watch Automatically generates the website to ./dist
# if a file in /src, /assets or /parts changed
Hint: You can also link the lste.py to your local bin directory to use it systemwide
This guide should help to setup a simple LSTE project:
- Create a file
lste.conf
in an empty folder and fill it with some settings (see next chapter) - Create the folders
./template
,./content
and./assets
- Place the actual content in
./content
, likeindex.md
orabout.md
. LSTE will generateindex.html
orabout.html
out of these files. - Use the
./assets
folder for you stylesheets, images etc. - Insert your template parts in the
./template
folder
The basic site data is stored in the lste.conf
. It must have following content:
[lste]
title = My LSTE Project
keywords = these, are, my, keywords
description = My very first LSTE project
These settings are the global settings and data of the project.
The template parts are simple HTML-files. LSTE needs two mandatory template files:
index.html
page.html
The code snippet {{part: my-template-part.html}}
allocates my-template-part.html
in the ./template
folder and includes its content. See example-simple
for an example.
LSTE has no further configuration for the assets folder. It simply copies all its content to the destination so you can use anything in there you want.
There are built-in functions which display different kind of information
{{title}}
: Renders the title{{keywords}}
: Renders the meta keywords{{meta-description}}
: Renders the meta description{{timestamp}}
: Renders a unix timestamp when the page was generated by LSTE
You can start LSTE with the argument --watch
(or -w
). It automatically checks for modifications in the folders ./template
, ./content
, ./assets
and the lste.conf
file. If anything changes there or a file is added, the website will be generated automatically.
./lste.py --path=./example --watch
Starts the watcher for the ./example
project.
LSTE itself is very limited in its functionality but it comes with a plugin system which allows expanding everything in LSTE.
Currently there are following currated plugins available:
- Meta allows the usage of meta fields throught an LSTE project
- Active Menu which allows to indicate which menu entry should be active
- Articles enables a blog like content management
- Excerpts Markdown enables markdown rendering for excerpts
- RSS generates an RSS-Feed out of the articles.
See the readmes on the plugins for more information about their functionality.
Using plugins in LSTE is fairly easy:
- Create a file in your home directory called
.listerc
- Place the content for the plugins into it whereas the value is the shortened address of the plugin on github:
[plugins]
active-menu = lauratheq/active-menu.lste
meta = lauratheq/meta.lste
articles = lauratheq/articles.lste
excerpts-markdown = lauratheq/excerpts-markdown.lste
rss = lauratheq/rss.lste
And that's it. LSTE will download the plugins with the next page generation.
Please note that this project is adapting the Contributor Code of Conduct from WordPress.org even though this is not a WordPress project. By participating in this project you agree to abide by its terms.
- Grab an issue
- Fork the project
- Add a branch with the number of your issue
- Develop your stuff
- Commit to your forked project
- Send a pull request to the main branch with all the details
Please make sure that you have set up your user name and email address for use with Git. Strings such as silly nick name <root@localhost>
look really stupid in the commit history of a project.
Due to time constraints, you may not always get a quick response. Please do not take delays personally and feel free to remind.
- Every new issue gets the label 'Request'
- Every commit must be linked to the issue with following pattern:
#${ISSUENUMBER} - ${MESSAGE}
- Every PR only contains one commit and one reference to a specific issue