| Name | Size |
|---|---|
| .gitignore | 30B |
| .htaccess | 311B |
| CHANGES.md | 396B |
| Makefile | 568B |
| README.md | 3442B |
| api.php | 6547B |
| composer.json | 127B |
| extractmessages.sh | 254B |
| index.php | 1993B |
| package.json | 191B |
| static/file.png | 637B |
| static/folder.png | 757B |
| static/main.js | 999B |
| static/main.scss | 1316B |
| templates/.htaccess | 14B |
| templates/base.html | 923B |
| templates/error.html | 111B |
| templates/files.html | 1571B |
| templates/page.html | 840B |
| templates/pages.html | 674B |
| templates/site.html | 408B |
| templates/users.html | 762B |
| themes/.htaccess | 14B |
| themes/default/default.html | 1164B |
| themes/default/sitemap.xml | 516B |
| trans/de.yml | 760B |
| utils.php | 3251B |
| vendor/.htaccess | 14B |
| views.php | 4097B |
pupupu - simple static CMS for crappy servers
Static website generators are awesome because of two reasons:
- the website is fast and secure because no code is running on the server
- developers can use all their favourite tools (e.g. text editors or git)
The big downside is that usability for non-developers is poor because they usually do not know about text editors and git.
Lektor calls itself a "static content management system". It is a static website generator, but it also has a web UI to edit the source files. This way, it feels a lot like a CMS while maintaining most of the benefits of a static website generator.
Unfortunately, many hosters still only offer PHP. So Lektor, which is written in python, is not an option.
So here I present: A simple static CMS for crappy servers!
Quickstart
- Get the latest zip file from https://github.com/xi/pupupu/releases
- Unpack to your webserver
- Create your templates in a folder called
_templates/. For starters, you can copy an example theme frompupupu/themes/. Don't forget to add some CSS! - Open
https://yourdomain.com/pupupu/in a browser - Start creating your content!
Documentation
Folder Structure
The following files and folders are relevant for your project:
/pupupu/- UI for editing/_templates/- template files/_templates/default.html- default template/_content/- source files/_content/_site.yml- contains site-wide config/_content/_users.yml- password hashes/files/- uploaded files
Content
For each page, there is a corresponding yaml and markdown file in /_content/.
The template can be defined in the yaml file using the _template key. If none
is specified, default.html is used.
Each time a page is saved in the UI, it automatically regenerated. If the site
config is saved, all pages are regenerated. If a page uses the API to include
content from other pages, you can add it to _dynamic in the site config to
regenerate it each time any page is saved.
Files and Folders
Most pages will be represented as a folder containing the files index.yml and
index.md. This will generated a folder containing index.html. Browsers can
skip the index.html part, resulting in nice URLs.
Still, there are some cases where you need to control the file name. For this
reason, a different pattern is used if the page name contains a dot: If you
create a page called "feed.xml", the corresponding files are called
feed.xml.yml and feed.xml.md and will generate feed.xml. (Pages that have
a dot in their name can consequently not have subpages.)
Templates
Twig is used as templating system. The following variables are available in a template:
path- path to current pagepage- the data from the page's yaml filebody- the contents of the page's markdown filesite- the data from `/_content/_site.ymlpupupu- an interface through which you can access arbitrary data (useful for feeds or index pages). Please refer to the source code for a list of methods.
There are also some special filters available:
md- render markdown using PHP Markdown Extrashift_headings- useful to fit user-generated content into the document outline