From 55a497fe021d0f1ff289c4931d0594d6ce19757b Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Fri, 5 Apr 2024 17:51:11 +0200 Subject: [PATCH] Fix bugs and errors --- lib/posts.lua | 2 +- pages/index.html.skooma.yue | 2 +- templates/post.html.skooma.yue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/posts.lua b/lib/posts.lua index cf4e816..6b33b97 100644 --- a/lib/posts.lua +++ b/lib/posts.lua @@ -49,7 +49,7 @@ for file in restia.utils.files(params.input, "^./posts/.*%.md$") do post.head.tags = string.split(post.head.tags, "[%a-]+") end - for key, tag in ipairs(post.head.tags) do + for key, tag in ipairs(post.head.tags or {}) do post.head.tags[key] = string.lower(tag) end diff --git a/pages/index.html.skooma.yue b/pages/index.html.skooma.yue index dfb32c5..1dc26e5 100644 --- a/pages/index.html.skooma.yue +++ b/pages/index.html.skooma.yue @@ -23,7 +23,7 @@ slots.head slots.head script type: 'module', src: "/javascript/LocalDate.js" slots.head script type: 'module', src: "/javascript/BlogPost.js" -return div +return main class: "content-width" * h1 "Blog Posts" * [blogPost post p for p in *posts] diff --git a/templates/post.html.skooma.yue b/templates/post.html.skooma.yue index 4d762d6..572fd17 100644 --- a/templates/post.html.skooma.yue +++ b/templates/post.html.skooma.yue @@ -29,7 +29,7 @@ positions = (input, character) -> breadcrumb = (href) -> li a :href, href\match('[^/]+$'), tabindex: 0 -if src = post.head.cover_image +if src := post.head.cover_image slots.top pageHero cover: 60 * img :src, style: 'opacity: .4' * h1(post.head.title, style: "view-transition-name: #{post.head.slug}")