pupupu

simple static CMS for crappy servers
git clone https://git.ce9e.org/pupupu.git

commit
3e93eac37289d84e41e1c83a1a2e764afaa9b4f0
parent
97c9180b437d288361bc75778a657ede85c625f2
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2018-10-19 13:52
add README

Diffstat

M Makefile 2 +-
A README.md 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2 files changed, 86 insertions, 1 deletions


diff --git a/Makefile b/Makefile

@@ -11,4 +11,4 @@ node_modules:
   11    11 	sassc $< > $@
   12    12 
   13    13 pupupu.zip:
   14    -1 	cd .. && zip -r -FS pupupu/$@ pupupu/index.php pupupu/static/ pupupu/templates/ pupupu/themes/ pupupu/vendor/ pupupu/node_modules/font-awesome/css/ pupupu/node_modules/font-awesome/fonts/ pupupu/node_modules/simplemde/dist/
   -1    14 	cd .. && zip -r -FS pupupu/$@ pupupu/index.php pupupu/README.md pupupu/static/ pupupu/templates/ pupupu/themes/ pupupu/vendor/ pupupu/node_modules/font-awesome/css/ pupupu/node_modules/font-awesome/fonts/ pupupu/node_modules/simplemde/dist/

diff --git a/README.md b/README.md

@@ -0,0 +1,85 @@
   -1     1 # pupupu - simple static CMS for crappy servers
   -1     2 
   -1     3 [Static website generators](https://www.staticgen.com/) are awesome because of
   -1     4 two reasons:
   -1     5 
   -1     6 -   the website is fast and secure because no code is running on the server
   -1     7 -   developers can use all their favourite tools (e.g. text editors or git)
   -1     8 
   -1     9 The big downside is that usability for non-developers is poor because they
   -1    10 usually do not know about text editors and git.
   -1    11 
   -1    12 [Lektor](https://www.getlektor.com/) calls itself a "static content management
   -1    13 system". It is a static website generator, but it also has a web UI to edit the
   -1    14 source files. This way, it feels a lot like a CMS while maintaining most of the
   -1    15 benefits of a static website generator.
   -1    16 
   -1    17 Unfortunately, many hosters still only offer PHP. So Lektor, which is written
   -1    18 in python, is not an option.
   -1    19 
   -1    20 So here I present: A simple static CMS for crappy servers!
   -1    21 
   -1    22 ## Quickstart
   -1    23 
   -1    24 -   Get the latest zip file from <https://github.com/xi/pupupu/releases>
   -1    25 -   Unpack to your webserver
   -1    26 -   Create your templates in a folder called `_templates/`. For starters, you
   -1    27     can copy an example theme from `pupupu/themes/`. Don't forget to add some
   -1    28     CSS!
   -1    29 -   Open `https://yourdomain.com/pupupu/` in a browser
   -1    30 -   Start creating your content!
   -1    31 
   -1    32 ## Documentation
   -1    33 
   -1    34 ### Folder Structure
   -1    35 
   -1    36 The following files and folders are relevant for your project:
   -1    37 
   -1    38 -   `/pupupu/` - UI for editing
   -1    39 -   `/_templates/` - template files
   -1    40 -   `/_templates/default.html` - default template
   -1    41 -   `/_content/` - source files
   -1    42 -   `/_content/_site.yml` - contains site-wide config
   -1    43 -   `/files/` - uploaded files
   -1    44 
   -1    45 ### Content
   -1    46 
   -1    47 For each page, there is a corresponding yaml and markdown file in `/_content/`.
   -1    48 The template can be defined in the yaml file using the `_template` key. If none
   -1    49 is specified, `default.html` is used.
   -1    50 
   -1    51 Each time a page is saved in the UI, it automatically regenerated. If the site
   -1    52 config is saved, all pages are regenerated. If a page uses the API to include
   -1    53 content from other pages, you can add it to `_dynamic` in the site config to
   -1    54 regenerate it each time any page is saved.
   -1    55 
   -1    56 #### Files and Folders
   -1    57 
   -1    58 Most pages will be represented as a folder containing the files `index.yml` and
   -1    59 `index.md`. This will generated a folder containing `index.html`. Browsers can
   -1    60 skip the `index.html` part, resulting in nice URLs.
   -1    61 
   -1    62 Still, there are some cases where you need to control the file name. For this
   -1    63 reason, a different pattern is used if the page name contains a dot: If you
   -1    64 create a page called "feed.xml", the corresponding files are called
   -1    65 `feed.xml.yml` and `feed.xml.md` and will generate `feed.xml`. (Pages that have
   -1    66 a dot in their name can consequently not have subpages.)
   -1    67 
   -1    68 ### Templates
   -1    69 
   -1    70 [Twig](https://twig.symfony.com/) is used as templating system. The following
   -1    71 variables are available in a template:
   -1    72 
   -1    73 -   `page` - the data from the page's yaml file
   -1    74 -   `body` - the contents of the page's markdown file
   -1    75 -   `site` - the data from `/_content/_site.yml
   -1    76 -   `pupupu` - an interface through which you can access arbitrary data (useful
   -1    77     for feeds or index pages). Please refer to the source code for a list of
   -1    78     methods.
   -1    79 
   -1    80 There are also some special filters available:
   -1    81 
   -1    82 -   `md` - render markdown using [PHP Markdown
   -1    83     Extra](https://michelf.ca/projects/php-markdown/extra/)
   -1    84 -   `shift_headings` - useful to fit user-generated content into the document
   -1    85     outline