Mercurial Hosting > freedit
view src/lib/Config.luan @ 10:de0cbf515ef5
remove author_id
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 30 Jun 2022 11:11:00 -0600 |
parents | fc2383eb48a9 |
children | 94e26bffd4fb |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local Db = require "site:/lib/Db.luan" local Config = {} Config.default_text = [[ local Forum = require "site:/lib/Forum.luan" Forum.title = "Your Forum" ]] local doc = Db.get_document("type:config") Config.text = doc and doc.config or Config.default_text function Config.set(text) local doc = Db.get_document("type:config") or {type="config"} doc.config = text Db.save(doc) end return Config