Re: [dev] mkws(1) - simple static site generator

From: Adrian Grigore <adrian.emil.grigore_AT_gmail.com>
Date: Tue, 1 Sep 2020 19:55:14 +0300

Thanks for your feedback!

I agree that shell script is sort of a natural fit for templating, you
just take plain text and massage it into HTML.

There are 3rd party solutions for ugc for static sites like
https://staticman.net/ which are acceptable.

OpenBSD stat is used to generate the timestamp for invalidating the
cache on css and js files for example.

<link rel=stylesheet href=theme.css?$(stat -f '%Sm' -t
'%Y-%m-%dT%H:%M:%SZ' "theme.css">

GNU stat has a different parameter signature, so I just bundled the
OpenBSD one in the binary packages
for distribution reasons. I could create a set of simple utilities to
generate that timestamp and bundle
them in the binary package.

I plan to create "plugin" scripts stored in ./share/libexec which
would be called from the main mkws binary.

On Tue, Sep 1, 2020 at 11:59 AM Thomas Oltmann
<thomas.oltmann.hhg_AT_gmail.com> wrote:
>
> Am Di., 1. Sept. 2020 um 10:49 Uhr schrieb Thomas Oltmann
> <thomas.oltmann.hhg_AT_gmail.com>:
> > Take navigation menus as an example. It is my understanding that werc
> > offers a pre-baked solution for this.
> > In mkws, if I needed a navigation bar on my pages, what I might do is
> > I could write a mknav.sh script that scans
> > through my source folder and outputs a list of links in HTML markup,
> > which I then call at the start of each .upphtml file.
>
> Nevermind, I just found out about l.upphtml, so this example is mute.
>


-- 
Thank you,
Adi,
Freelance Developer
http://adi.tilde.institute/
Received on Tue Sep 01 2020 - 18:55:14 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 01 2020 - 19:00:08 CEST