diff options
| author | Stanisław Zagórowski <hasohasacz@gmail.com> | 2024-01-15 14:21:34 +0100 |
|---|---|---|
| committer | Stanisław Zagórowski <hasohasacz@gmail.com> | 2024-01-15 14:21:34 +0100 |
| commit | 63ea67e4c3c8caa2cf0dc6d7c940981bd40b3974 (patch) | |
| tree | 9900794e80bd4413ceb4dad72cdfc3eeaf0d6c9b /luax/blog/cache.lua | |
| parent | d5c0555775ac835f75246a17b5e6f3ddc353d82b (diff) | |
all: move out from luax/
Diffstat (limited to 'luax/blog/cache.lua')
| -rw-r--r-- | luax/blog/cache.lua | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/luax/blog/cache.lua b/luax/blog/cache.lua deleted file mode 100644 index e8f5b0c..0000000 --- a/luax/blog/cache.lua +++ /dev/null @@ -1,23 +0,0 @@ -local md = require "libs.markdown" - -local blog_cache = {} - -local function get_blog_post_content(post) - local slug = post.slug - if blog_cache[slug] then - return blog_cache[slug] - end - -- pull markdown content from file - local content = io.open("blog/" .. slug .. ".md", "r"):read("*a") - - if content then - -- convert markdown to html - content = md(content) - end - - blog_cache[slug] = content - - return content -end - -return get_blog_post_content |
