- Shell 46%
- CSS 25.6%
- Python 22.6%
- Makefile 4.6%
- HTML 1.2%
Stupid-minimal CMS (sm-cms)
No-Bullshit, very (very, very) minimal "CMS"
- Write your content in markdown files
- Compile website to static html files
- Done
Requirements
- "pandoc" for file compilation (markdown to html)
- Python 3 for index generation
Installation
There is none. Clone this repo, fill markdown files with content, compile, upload generated HTML files and the CSS style file (default is style.css) to your webroot.
Usage
Create page
./create-page.sh pagename
This will generate a file named like this:
20190104_pagename.md
(date will of course be the current one on your system)
With this content:
$ cat 20190104_pagename.md
% pagename
I suggest to add new pages with this script, so you have a proper timestamp in the filename.
Build website
Simpy run
$ make
This will create/update the index file and compile all markdown files in the directory to HTML files.
Generate index
If you want to just update the index just run
make index
This will auto-generate the index.md file (while overwrite an existing one)
like this:
% foobar
* [Hello world!](hello-world.md)
* [pagename](20190104_pagename.md)
The list will include all .md files in the directory, except README.md and,
of course, index.md.
Entries will be sorted reversely, so most recent date timestamp in filename will be first. Or you change the value in the config file (see below).
Configuration
For this script to work, it's expected to have a sm-cms.ini file in the same
directory, with this content:
[general]
IndexFile = index.md
IndexTitle = foobar
ReverseSorting = true
There is also a header.html file, which contains a very simple header with
just a link back to index.html.
Compile HTML files
make website
This will generate HTML files from all markdown files in the directory, except README.md
Upload site
Put your data in upload.sh:
#!/usr/bin/env bash
username="someuser"
hostname="example.domain"
webroot="/var/www/example.domain"
scp *.html style.css "$username"@"$hostname":"$webroot"
And just run
$ make upload
to upload all HTML files and the style.css file.