main
README.md
mite
mite 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.
to build and serve the example site locally:
make
make serve
powered by mite
these sites use mite (if you make one, let me know!)
how to
- make a directory for your site at
sites/mywebsite/. - 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:
SITE_TITLE = mywebsite
SITE_SUBTITLE = mywebsiteisthebestwebsite.
DIRS = \ # list all directories in your site
$(OUT_DIR) \
$(OUT_DIR)/docs \
$(OUT_DIR)/pub
HTML_TARGETS = # leave this empty, see next step
STATIC_TARGETS = # you should put here any static files you want copied into the output, like images etc
include $(SRC_DIR)/mk/*
- then add some make fragments in
sites/mywebsite/mk/*.mk, one for every page you have:
PAGE := index
HTML_TARGETS := $(HTML_TARGETS) $(OUT_DIR)/$(PAGE).html # add the page to the list of html targets so make knows to build it.
TITLE.$(PAGE) = home # displayed at the top-middle of page
OS.$(PAGE) = mywebsite # displayed at the bottom-corner of the page
URL.$(PAGE) := /$(PAGE).html
#you should declare dependencies like this so make can incrementally rebuild for each page
$(OUT_DIR)/index.html: $(SRC_DIR)/mk/index.mk
$(OUT_DIR)/index.raw.html: $(SRC_DIR)/index.1
- add source files like
sites/mywebsite/index.1. you should write them in mdoc. - build with
make SITE=mywebsite
if you want to do css:
- put site css at
sites/mywebsite/_mite/style.cssto append it afterpub/style.css. - put
sites/mywebsite/_mite/mandoc.cssto replace the default openbsd mandoc css
you can look at the example in sites/example.com to get a good idea, or to use a starting point.