main
README.md
1mite
2----
3
4mite is a small static site generator which uses mandoc and make. right now you will need gnu make to build it, although very few gnu extensions are used.
5
6to build and serve the example site locally:
7```
8make
9make serve
10```
11
12powered by mite
13---------------
14these sites use mite (if you make one, let me know!)
15
16- [shrub.industries](https://shrub.industries)
17
18how to
19------
20
211. make a directory for your site at `sites/mywebsite/`.
222. add `sites/mywebsite/manifest.mk`. this includes the metadata about your site so the makefile knows how to build it. you can really write it however you want as long as you provide the right variables, but this is the template i recomend following:
23```
24SITE_TITLE = mywebsite
25SITE_SUBTITLE = mywebsiteisthebestwebsite.
26
27DIRS = \ # list all directories in your site
28 $(OUT_DIR) \
29 $(OUT_DIR)/docs \
30 $(OUT_DIR)/pub
31
32HTML_TARGETS = # leave this empty, see next step
33STATIC_TARGETS = # you should put here any static files you want copied into the output, like images etc
34
35include $(SRC_DIR)/mk/*
36```
37
383. then add some make fragments in `sites/mywebsite/mk/*.mk`, one for every page you have:
39```
40PAGE := index
41HTML_TARGETS := $(HTML_TARGETS) $(OUT_DIR)/$(PAGE).html # add the page to the list of html targets so make knows to build it.
42
43TITLE.$(PAGE) = home # displayed at the top-middle of page
44OS.$(PAGE) = mywebsite # displayed at the bottom-corner of the page
45URL.$(PAGE) := /$(PAGE).html
46
47#you should declare dependencies like this so make can incrementally rebuild for each page
48$(OUT_DIR)/index.html: $(SRC_DIR)/mk/index.mk
49$(OUT_DIR)/index.raw.html: $(SRC_DIR)/index.1
50```
514. add source files like `sites/mywebsite/index.1`. you should write them in mdoc.
525. build with `make SITE=mywebsite`
53
54if you want to do css:
55
56- put site css at `sites/mywebsite/_mite/style.css` to append it after `pub/style.css`.
57- put `sites/mywebsite/_mite/mandoc.css` to replace the default openbsd mandoc css
58
59you can look at the example in sites/example.com to get a good idea, or to use a starting point.