Skip to content

pickfire/www

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6c9a352 · Jun 3, 2021

History

67 Commits
Jun 3, 2021
Jul 7, 2019
May 23, 2020
Jun 3, 2021
Nov 21, 2017
May 23, 2020
Aug 16, 2019
Apr 7, 2018
Apr 1, 2016
Mar 6, 2017
Jun 3, 2021
Apr 6, 2018
Jan 25, 2016
Apr 8, 2018
May 23, 2020
Feb 9, 2017
Jun 3, 2021
Apr 6, 2018
Jul 29, 2016
Aug 16, 2019
Mar 6, 2017
Nov 19, 2018
May 23, 2020

Repository files navigation

SSSG - Stupid Static Site Generator

SSSG is a layout-based static site generator built for parallelism and minimalism while being flexible and feature-full. Think of it as a layer of glue, which glues layers of papers into 3D models. It's perfect for simple personal sites that adheres to the KISS Principle while being able to follow the Suckless Philosophy and get rid of Dependency Hell.

Why SSSG?

It gives you the choice to be in control of your own site. But in return, you need to give it love and time like a wise man once spoken: “先苦后甜”.

        Usage: make -j4 (or any number you like)

+--------------------+    +--------------------+    +--------------------+
|    _lay/main.sh    |    |    _lay/post.sh    |    |  post/_www/config  |
+--------------------+    +--------------------+    +--------------------+
|exit                |    |LAYOUT=_lay/main.dh+|    |LAYOUT=_lay/post.dh+|
+---------+----------+    |F=$FILE             |    |DATE=$(date $FILE)  |
          |               +---------+----------+    |T=$(head -n $FILE)  |
+---------+----------+              |               +---------+----------+
|   _lay/main.dhtml  |    +---------+----------+              |
+--------------------+    |   _lay/post.dhtml  |    +---------+----------+
|<!DOCTYPE html>     |    +--------------------+    |    post/test.md    |
|<html>              |    |${F}                |    +--------------------+
|  <head>            |    |====                |    |Why?                |
|    <title>${T}</ti+|    |                    |    |----                |
|  <head>            |    |${CONTENT}      <------  |- Parallel and fast |
|  <body>            |    |                    |    |- Markdown-powered  |
|    ${CONTENT}  <------  |---                 |    |- Minimal outputs   |
|    ...             |    |Created by ${DATE}  |    |- Flexiblility++    |
+--------------------+    +--------------------+    +------------------- +
                                                              ^
              --- rm -rf $(TARG)/*                            |
  +----------/                                                |
  |  clean   |        _bin/html.sh post/test.md > $(TARG)/post/test.html
  +==========+-----+ /
  | Makefile | all + ---- _bin/html.sh index.html > $(TARG)/index.html
  +==========+-----+ \
             |        +------ _bin/atom.sh post/ > $(TARG)/%/atom.xml
             |         \
             |          -------- gzip -9 (needed) + cp (needed)
      +------+--+
      |  check  | validate html/css/xml online -> ./check.sh $(TARG)
      +---------+

The installation is simple, just make this your site:

git clone git://github.com/pickfire/www --depth 1
rm -rf www/.git

Configurations can be done by editing config.sh and config.mk.

_dyn/tor needs to be manually linked to /srv/tor which uses fastcgi.

Rule

  1. The _www/config found at the previous/current directory of the input file will be sourced, shell script and variables are optional.

  2. Add shell functions/variables to file.sh (just change extension), these can aid in generating dynamic contents. E.g. menu

  3. In between those lines of code, add LAYOUT=_lay/layout.dhtml to paste the current content into layout.dhtml's ${CONTENT}. (Required)

  4. Use ${VAR} (must be UPPERCASE) in files to substitute it to the variable, unused variables (line) will be deleted when generation is completed.

  5. Makefile does not look for directories with names starting with _.

Need

Tool

  • atom.sh - Find Markdown files and generate an Atom feed from it
  • check.sh - Find HTML/CSS/XML files and verify it online
  • css.sh - Minify CSS files with sed and tr
  • html.sh - Output HTML content with a file as input
  • map.sh - Generate the sitemap and urllist

Help

Inspiration

Alternative

Implementation

About

http://pickfire.tk broken down into tiny pieces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published