Arnapou Simple site
Docker
This is the recommended way if you don't want to bother.
Useful links:
- Container versions on GitLab
- README.md on GitLab (with a
docker compose
example)
Basics
This solution is halfway between a static website and a dynamic website.
With a simple PHP file simplesite.phar
and an index.php
which initialize the website,
you will have a fully functional website :
<?php include '/path/to/simplesite.phar'; SimpleSite::run( // mandatory path_public: '/public/root/folder/of/website', // probably __DIR__ path_pages: '/private/folder/for/pages', path_cache: '/private/folder/for/caching', // ... there are other optional parameters // ... you can check their description into the index.php of this demo );
The idea is to create a "static" website composed of Twig files. This allows you to enrich, simplify and reuse HTML code that is static inside twig html files.
We can make a comparison with static site generators, but here, you can enrich the website with php.
PHP dependencies are reduced to the essentials to obtain the smallest possible PHAR file.
The phar size is 496 KB
.
Prerequisites
Have the right PHP version for simplesite.phar
concerned.
- knowledge of: HTML, CSS, JS
- templating: Twig
To take advantage of the maximum features, you will need to know:
Mindset
- simple
- lightweight
- easy maintenance
- perennial
- automatic fallbacks
- open minded