1
0
Fork
You've already forked sm-cms
0
stupid-minimal CMS
  • Shell 46%
  • CSS 25.6%
  • Python 22.6%
  • Makefile 4.6%
  • HTML 1.2%
Find a file
2025年01月19日 13:38:04 +01:00
.gitignore added gitignore with vims session file 2025年01月18日 20:38:09 +01:00
compile_pages.sh moved page compilation to separate script 2025年01月18日 19:03:12 +01:00
create_page.sh added feed db create to page creation script, continued on feed generation script 2025年01月18日 20:38:41 +01:00
gen_feed.sh finished basic feed generation 2025年01月19日 13:37:22 +01:00
gen_index.py updated python hashbang 2025年01月18日 19:04:27 +01:00
header.html finished basic feed generation 2025年01月19日 13:37:44 +01:00
hello_world.md renamed hello world file to follow the same schema as in the create_page.sh script, updated its content 2025年01月18日 19:05:28 +01:00
LICENSE Initial commit 2019年01月04日 16:27:38 +01:00
Makefile added feed thingies to makefile and upload script 2025年01月19日 13:38:04 +01:00
README.md updated readme 2025年01月18日 19:28:19 +01:00
sm-cms.ini finished basic feed generation 2025年01月19日 13:37:44 +01:00
style.css add actual content 2019年01月04日 16:33:08 +01:00
upload.sh added feed thingies to makefile and upload script 2025年01月19日 13:38:04 +01:00

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.