Guide

Publishing a site.

Take a folder of pages from an in-game computer and put it on the network, where anyone on any server can visit.

Before you start

You need an advanced computer with a wired or wireless modem, and HTTP enabled in the server config. Run lantern version to check the program is installed.

  • A site key from your dashboard.
  • A folder with at least an index.lua page.
  • About two minutes.

Write a page

Pages are small Lua files that return a page object. Start with a heading, a line of text and a guestbook so visitors can say hello.

site/index.lualua
-- site/index.lua: the first page visitors seelocal page = lantern.page("Welcome home") page:heading("A place worth finding.")page:text("A field guide. A build journal.")page:guestbook({ max = 50 }) return page

Publish it

From the folder above site, run the publish command with your key. Lantern uploads every page, checks it, and prints the address when it is live.

lantern publish ./site --key $SITE_KEY

Useful flags

  1. --draft uploads without making the site public.
  2. --watch republishes whenever a file changes.
  3. --quiet prints only the final address.

Next steps

Your site is live. Add a guestbook, set up a turtle relay for servers without HTTP, or read the Lua API to build something stranger.