Fix blurb in post list

This commit is contained in:
Catalin Constantin Mititiuc 2025-05-28 18:58:42 -07:00
parent 157686b183
commit bc205064cc

View File

@ -72,6 +72,8 @@ get_posts = (limit) =>
limit_or_page_count = math.min limit or #pages, #pages limit_or_page_count = math.min limit or #pages, #pages
[post for post in *pages[1, limit_or_page_count]] [post for post in *pages[1, limit_or_page_count]]
md_dir = "posts"
sitegen.create => sitegen.create =>
@site_title = "WebDevCat.me" @site_title = "WebDevCat.me"
@app_name = "stasis" @app_name = "stasis"
@ -86,7 +88,7 @@ sitegen.create =>
html.build -> html.build ->
import section, h3, time, a from tag import section, h3, time, a from tag
md = @site\get_renderer "sitegen.renderers.markdown" md = @site\get_renderer "renderers.markdown"
return for post in *posts return for post in *posts
{:title, :blurb, :id, :publish_date} = post.meta {:title, :blurb, :id, :publish_date} = post.meta
@ -106,7 +108,7 @@ sitegen.create =>
add_all = (files) -> add_all = (files) ->
[add path, { [add path, {
target: target path, "/posts" target: target path, md_dir
template: "post" template: "post"
is_a: "post" is_a: "post"
publish_date: publish_date extract_date path publish_date: publish_date extract_date path
@ -121,7 +123,7 @@ sitegen.create =>
title: "Code Syntax Highlight Samples" title: "Code Syntax Highlight Samples"
publish_date: publish_date date true publish_date: publish_date date true
add_all files_from "posts" add_all files_from md_dir
copy "app.css" copy "app.css"
copy "pygments.css" copy "pygments.css"
@ -129,7 +131,7 @@ sitegen.create =>
copy "pandoc.css" copy "pandoc.css"
-- replace post markdown yaml headers with moonscript headers -- replace post markdown yaml headers with moonscript headers
filter "docs", (body) => filter md_dir, (body) =>
body\gsub "^%-%-%-.-%.%.%.", (yaml_header) -> body\gsub "^%-%-%-.-%.%.%.", (yaml_header) ->
header = yaml_header\gsub "%-%-%-", "{" header = yaml_header\gsub "%-%-%-", "{"
moonscript_header = header\gsub "%.%.%.", "}" moonscript_header = header\gsub "%.%.%.", "}"