2025-05-25 18:08:05 -07:00
2025-05-22 09:28:40 -07:00
2025-05-23 19:16:07 -07:00
2025-05-25 18:08:05 -07:00
2025-05-15 12:33:25 -07:00
2025-05-09 18:03:43 -07:00
2025-05-23 16:45:09 -07:00
2025-05-24 13:18:30 -07:00
2025-05-25 18:03:44 -07:00
2025-05-16 10:53:31 -07:00
2025-05-16 10:53:31 -07:00
2025-05-23 16:39:51 -07:00
2025-05-25 18:03:44 -07:00
2025-05-23 16:41:33 -07:00
2025-05-25 18:08:05 -07:00
2025-05-25 18:03:44 -07:00

requirements

pandoc utility must be installed

  • Debian Bookworm:

    $ apt-get update && apt-get install -y pandoc
    

start default openresty

  1. Run docker run --rm -it --init -w /opt -v $PWD:/opt -p 80:80 openresty/openresty:1.27.1.2-0-bookworm-buildpack
  2. Visit localhost in web browser.

start a custom site

build docker image

$ docker build -t sitegen-openresty .

generate a new site file

$ docker run --rm -w /opt -v $PWD:/opt sitegen-openresty sitegen new

add an index page

$ docker run --rm -w /opt -v $PWD:/opt sitegen-openresty sitegen page /opt/ index

add to site.moon

add "index.md"

add config for nginx

$ mkdir logs/ conf/

# conf/nginx.conf
worker_processes  1;
error_log logs/error.log;
events {
    worker_connections 1024;
}
http {
    server {
        listen 8080;
        location / {
            default_type text/html;
        }
    }
}

build site

$ docker run --rm -w /opt/app -v $PWD:/opt/app sitegen-openresty sitegen

or

$ make build

start server

$ docker run --rm -it --init -v $PWD:/opt/app -p 8080:8080 sitegen-openresty

or

$ make

Visit localhost:8080 in web browser

start watcher

$ docker exec -it container_name sitegen watch

lint moonscript

$ make lint

gotchas

What is cosmo failed: [string "..."]:62: cannot resume dead coroutine?

If you call cosmo.yield, your function must return nil! If you forget to return nil, you will see this cryptic error:

Error: index.html -> html/index.html: cosmo failed: [string "..."]:62: cannot resume dead coroutine
make: *** [Makefile:6: build] Error 1`

todo

  • draft documents
  • treesitter highlighting for moonscript
  • penlight library
Description
Source code for website miti.sh
Readme 8 MiB
Languages
MoonScript 42.7%
CSS 31.6%
Python 8.1%
HTML 7.5%
Dockerfile 3.3%
Other 6.8%