ruhiger Sommer im Garten in Geras

Andrew U. Frank

Andrew U. Frank

em.o.Univ.Prof. Dr. sc.techn. Dr. h.c. Dipl.Ing.

Andrew U. Frank

Principles of SSG design

Why yet another static site generator? Pandoc provides nearly everything and gives the desired functionality (code in Haskell, markdown as primary text input, backup with git). (pdf)

March 5, 2019

Goals

Packages available in Haskell

A number of tools are available from Hackage:

They should be used as far as possible!

Well designe tools combine cleanly

Tools which survive the test of time provide abstractions which combine without unexpected interactions and confusions.

Programmable

It is my experience when adaptation is needed anything short of a complete (and well designed) programming language leads to an infinite sequence of special case additions bolted on with some ugly screws; I have the impression that this is a imitation of e.g. Sprinkles.

Uniform interfaces for packages used

Wrap packages into a small interface layer to locally hide differences between packages which hinder integration. In Haskell, such differences tend to show up as multiple options to achieve more or less the same ends. I tend to think this is preferably over the use of a special prelude which makes collaboration with others difficult.

My uniform approach

Separate Theme and Content

The data should be separated from the style of presentation, to

The theme (templates, css etc.) and the content should be separated, with a documented interface. Default locations for theme and content can be adapted to needs.

Performance

SSG is mostly a proof of concept and demonstration for small academic homepages, it is not optimized for humongous web pages for large organizations. Performance is not designed inThe caching mechanism of shake, however, should make even large web sites viable

; if performance is too slow for a specific use, localize the issue and tweak the code were performance is an issue.

The use of twich and shake gives a nearly dynamic behavior: changes are reflected quickly in locally served pages, when ssgbake is run with the -w switch.The mechanism works well for local changes in a page but requires some tweaking when an index page is produced during bake by collecting data from multiple other pages in a directory; typically delete at least the index.html page in the baked homepage and re-run ssgbake.

The conversion of the markdown to latex is, as currently implemented, slow; it requires separate processes for different steps in the conversion in a suboptimal fashion and could be improved.

Character file based to facilitate backup and version management

The storage of content should be in text files which can be edited with any editormy preference is currently VScode, but no special features are relied on

, versioned with git and backed up with ordinary toolsGit operations can conflict with other tools to synchronize file content between installations (e.g. syncthing).

.

Let the directory structure reflect the structure of the site

The primary structure of a site should be reflected in the directory structure where the files for the pages are stored.

It is acceptable that the file names can be restricted (e.g. must not include spaces) and facilities to translate the file names into readable titles must be provided.

Many site generator, especially flexible content management systems, use databases like SQL for storage of date; for small sites, full function databases are too complex and notoriously difficult to integrate, backup and vulnerable to attacks from hacker.

Customization

A web site is infinitely customizable; the difficulty is to decide which customizations are provided at a common user level, which others are accessible only through tweaking the underlying technology and how accessibly such tweaks are.

I have opted for a minimal set of options to customize:

and most everything else is simply text in sources for web pages.

Any further adaption relies on some understanding of the underlying technology; accessible is

Customization beyond will likely require forking the source code and changes in it.

Documentation not yet done

Desirable features

Support for the development of a web site

It should be possible to add new pages without them immediately going live.

Allow some parts of a web site to be protected from the public

No everything in a web site should be automatically visible to everybody; it should be possible to protect some pages or groups of pages with passwords or some similar means.

Produced with `daino` from Essays/SSGdesign/06rationale/010Principles.html (public, publish) with master7tufte.dtpl.
daino and w3.css