A webmail client. Forked from https://git.sr.ht/~migadu/alps
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
658 B

  1. -- This message will be printed when the plugin is loaded
  2. print("Hi, this is an example Lua plugin")
  3. -- Setup a function called when the mailbox view is rendered
  4. alps.on_render("mailbox.html", function(data)
  5. print("The mailbox view for " .. data.Mailbox.Name .. " is being rendered")
  6. -- Set extra data that can be accessed from the mailbox.html template
  7. data.Extra.Example = "Hi from Lua"
  8. end)
  9. -- Wire up a new route
  10. alps.set_route("GET", "/example", function(ctx)
  11. ctx:String(200, "This is an example page.")
  12. end)
  13. -- Set a filter function that can be used from templates
  14. alps.set_filter("example_and", function(a, b)
  15. return a .. " and " .. b
  16. end)