Mercurial Hosting > luan
comparison examples/blog/src/index.html.luan @ 1707:ad5647031343
fix blog
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Mon, 04 Jul 2022 12:40:59 -0600 |
| parents | bc40bc9aab3a |
| children | 28cd9b3abdb3 |
comparison
equal
deleted
inserted
replaced
| 1706:93b9fd13a06c | 1707:ad5647031343 |
|---|---|
| 1 local Luan = require "luan:Luan.luan" | 1 local Luan = require "luan:Luan.luan" |
| 2 local error = Luan.error | 2 local error = Luan.error |
| 3 local ipairs = Luan.ipairs or error() | 3 local ipairs = Luan.ipairs or error() |
| 4 local Time = require "luan:Time.luan" | 4 local Time = require "luan:Time.luan" |
| 5 local Io = require "luan:Io.luan" | 5 local Io = require "luan:Io.luan" |
| 6 local Parsers = require "luan:Parsers.luan" | |
| 7 local bbcode_to_html = Parsers.bbcode_to_html or error() | |
| 8 local Html = require "luan:Html.luan" | 6 local Html = require "luan:Html.luan" |
| 9 local html_encode = Html.encode or error() | 7 local html_encode = Html.encode or error() |
| 10 local Http = require "luan:http/Http.luan" | 8 local Http = require "luan:http/Http.luan" |
| 11 local Post = require "site:/lib/Post.luan" | 9 local Post = require "site:/lib/Post.luan" |
| 12 | 10 |
| 42 <p> | 40 <p> |
| 43 <%= Time.format(post.date) %> | 41 <%= Time.format(post.date) %> |
| 44 - <a href="edit.html?post=<%= post.id %>">Edit</a> | 42 - <a href="edit.html?post=<%= post.id %>">Edit</a> |
| 45 - <a href="delete?post=<%= post.id %>">Delete</a> | 43 - <a href="delete?post=<%= post.id %>">Delete</a> |
| 46 </p> | 44 </p> |
| 47 <pre><%= bbcode_to_html(html_encode(post.content)) %></pre> | 45 <pre><%= html_encode(post.content) %></pre> |
| 48 <hr> | 46 <hr> |
| 49 <% | 47 <% |
| 50 end | 48 end |
| 51 %> | 49 %> |
| 52 | 50 |
