blob: 48991a0ec0cbf9e38a798da0fbba3a73a5739020 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
.Dd December 2025
.Dt KEW 1
.Os
.
.Sh NAME
.Nm kew
.Nd super simple static site supplier
.
.Sh SYNOPSIS
.Nm kew
.Ar <in>
.Ar <out>
.
.Sh DESCRIPTION
.Nm
is a minimal static site generator inspired by werc.
It transforms a directory tree containing Markdown files and static assets
into a fully static HTML website.
.
.Pp
The filesystem defines structure, navigation, and meaning. There is no metadata, database, runtime server, or dynamic behaviour.
.
.Sh OPERATION
Given an input directory and an output directory
.Nm
does this:
.
.Bl -bullet -compact
.It
recursively walks the input directory tree.
.It
mirrors the directories structure into the output directory.
.It
copies all non Markdown files.
.It
converts all
.Pa .md
files into
.Pa .html
using
.Xr lowdown 1 .
.It
shoves all generated HTML pages in a single global HTML template.
.It
generates navbar from the directory hierarchy.
.El
.
.Pp
The resulting output directory is suitable to be directly served by any HTTP server.
.
.Sh MARKDOWN PROCESSING
Markdown files are converted to HTML using
.Xr lowdown 1 .
.
.Pp
For every file:
.Bd -literal -offset indent
page.md->page.html
.Ed
.
.Pp
Relative links referring to
.Pa .md
files are rewritten to point to the correct
.Pa .html
files.
.
.Sh TEMPLATE
The HTML template is a regular HTML file located at the root of the input
directory.
Its filename is defined at compile time.
.
.Pp
The template should contain the following placeholders:
.
.Bl -tag -width Ds
.It Li {{TITLE}}
replaced with the site title.
.It Li {{NAV}}
replaced with the generated navbar HTML.
.It Li {{CONTENT}}
replaced with the page content.
.It Li {{FOOTER}}
replaced with footer text.
.El
.
.Pp
All pages use the same template. No per-page templating is supported.
.
.Sh FILE LAYOUT
Example input layout:
.Bd -literal -offset indent
in/
|-->index.md
|-->docs/
| |-->system/
| |-->init.md
| |-->networking/
| |-->ethernet.md
|
|-->style.html
|-->template.html
.Ed
.
.Pp
Corresponding output layout:
.Bd -literal -offset indent
out/
|-->index.html
|-->docs/
| |-->system/
| |-->init.html
| |-->networking/
| |-->ethernet.html
|
|-->style.html
|-->template.html
.Ed
.
.Sh CONFIGURATION
.Nm
Edit
.Pa config.go
then recompile.
.
.Pp
Configuration values:
.
.Bl -bullet -compact
.It
Site title
.It
Footer text
.It
Template filename
.It
Navigation symbols
.El
.
.Sh EXIT STATUS
.Ex -std
.
.Sh DEPENDENCIES
.Bl -bullet -compact
.It
.Xr lowdown 1
.El
.
.Sh PHILOSOPHY
.Nm
is intentionally opinionated. Trying to follow the UNIX philosophy well enough.
.
.Pp
Users are expected to understand basic filesystem concepts.
.
.Sh SEE ALSO
.Xr lowdown 1 ,
.Xr httpd 8
.
.Sh AUTHORS
.Nm
was written by
.An uint .
|