{
  "format": 1,
  "files": {
    "app.lua": "return function(ctx)\n  local P=ctx.page\n  local entries=ctx.read('entries',{})\n  if ctx.method=='POST' and ctx.path=='/sign' then\n    local text=tostring(ctx.fields.message or ''):sub(1,240)\n    if text:match('%S') then\n      entries[#entries+1]={text=text,id=ctx.requestId}\n      while #entries>30 do table.remove(entries,1) end\n      ctx.write('entries',entries)\n    end\n    return {kind='redirect',path='/'}\n  end\n  if ctx.path~='/' then return nil end\n  local children={P.heading{text='Leave a little warmth'},P.paragraph{text='A guestbook for passing travelers. Notes are public.'}}\n  for _,entry in ipairs(entries) do children[#children+1]=P.paragraph{text=entry.text} end\n  children[#children+1]=P.form{action='/sign',children={P.input{name='message',text='Your note'},P.submit{text='Sign guestbook'}}}\n  return {kind='page',page=P.document('Guestbook',children)}\nend\n",
    "index.json": "{\n  \"version\": 1,\n  \"title\": \"Guestbook\",\n  \"children\": [\n    {\n      \"type\": \"heading\",\n      \"text\": \"Guestbook\"\n    },\n    {\n      \"type\": \"paragraph\",\n      \"text\": \"Leave a note for the next traveler.\"\n    },\n    {\n      \"type\": \"columns\",\n      \"children\": [\n        {\n          \"type\": \"section\",\n          \"children\": [\n            {\n              \"type\": \"heading\",\n              \"text\": \"Explore\"\n            },\n            {\n              \"type\": \"paragraph\",\n              \"text\": \"Built for our world.\"\n            }\n          ]\n        },\n        {\n          \"type\": \"section\",\n          \"children\": [\n            {\n              \"type\": \"heading\",\n              \"text\": \"Make it yours\"\n            },\n            {\n              \"type\": \"paragraph\",\n              \"text\": \"Edit this page with Lantern.\"\n            }\n          ]\n        }\n      ]\n    },\n    {\n      \"type\": \"link\",\n      \"text\": \"Back to Lantern\",\n      \"href\": \"ln://home\"\n    }\n  ]\n}\n"
  }
}
