oooo                      oooo   
         ,88                       ,88   
 ,oooo.  o8' oooo  oo o.   ,ooo.   o88o. 
 o8( )p ,88   `88  88 `8  ,88",8  ,88"`8o
 `o8o.  88'    88 ,88 ,8  88ooo^  88'  )8
d( )8o  o8. .  88o"88,o"  88' .   o8. ,8"
# slweb

slweb is a static website generator which aims at being simplistic. It transforms custom Markdown-like syntax into HTML.


## Manual

See
=> https://strahinja.srht.site/man/slweb/slweb.1.html	https://strahinja.srht.site/man/slweb/slweb.1.html


## Q&A

Q: Is this suckless?
A: No. SGML, and by extension, HTML, isn't suckless.

Q: Why do you call it "simple" then?
A: Because one is not the synonym for the other.

Q: Why not make a website generator as a shell script?
A: slweb was a shell script in its conception (check its history of commits in git). However, I wanted to implement Markdown links with link ids [like][this]. This requires multiple passes by the parser and is better implemented as a full-blown program in C anyway. The other reason was that sed and awk have limits, which some of my pages hit.

Q: My static website generator is "truly simple", this is not simple!
A: Good for you. By the way, that is a statement and not a question.


## Prerequisites

* C compiler - defaults in config.mk


## Optional dependencies

* KaTeX for math mode
* git (for {git-log})
* identify from ImageMagick (for )

=> https://katex.org		KaTeX
=> https://imagemagick.org	ImageMagick


## Install

$ git clone https://git.sr.ht/~strahinja/slweb

$ cd slweb

$ su

make install

with

=> https://gameoftrees.org	got:

$ got clone https://git.sr.ht/~strahinja/slweb

$ got checkout slweb.git

$ cd slweb

$ su

make install


## Persistent build configuration file

The file config.mk will be sourced when building targets which also accept configuration through environment variables.  For example, CC and PREFIX are specified in config.mk.


## OpenBSD

Before running make(1), comment the CPPFLAGS definition in config.mk above the line with the “OpenBSD” comment and uncomment the one below it:

CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L \

-D_XOPEN_SOURCE=700

OpenBSD

CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L \

	  -D_XOPEN_SOURCE=700 -D_BSD_SOURCE

Also, do the same for MANPREFIX:

MANPREFIX = $(DESTDIR)$(PREFIX)/share/man

OpenBSD

MANPREFIX = $(DESTDIR)$(PREFIX)/man


## Install (Arch)

$ git clone https://aur.archlinux.org/slweb.git

$ cd slweb

$ makepkg -si


## Examples

See the examples/ directory in this repository.

=> https://git.sr.ht/~strahinja/slweb/tree/master/item/examples examples/

Given the file index.slw in the current directory:


site-name: Test website

site-desc: My first website in slweb


{main}

Hello world

This is an example of a statically generated HTML.

{/main}

after using the command:

$ slweb index.slw > index.html

file `index.html` contains:

<title>Test website</title>

<meta charset="utf8">

<meta name="description" content="My first website in slweb">

<meta name="viewport" content="width=device-width, initial-scale=1">

<meta name="generator" content="slweb">

Proxy Information
Original URL
gemini://gemini.strahinja.org/slweb
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
142.925453 milliseconds
Gemini-to-HTML Time
0.887706 milliseconds

This content has been proxied by September (ba2dc).