diff --git a/README.md b/README.md index fc868af..7a24617 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,6 @@ or ## todo -* page titles - * draft documents * treesitter highlighting for moonscript * penlight library diff --git a/about.html b/about.html new file mode 100644 index 0000000..ff407a0 --- /dev/null +++ b/about.html @@ -0,0 +1,5 @@ +$some[[
$one and then $two
]] + +$if{ true, target = 'World' }[[ Hello $target! ]], [[ Hi $target! ]] + +$each{ { thing = "bye" }, { thing = "hello" } }[[$thing]] diff --git a/site.moon b/site.moon index 2743030..4bb6fdc 100644 --- a/site.moon +++ b/site.moon @@ -83,14 +83,25 @@ list_posts = (page, limit) -> } } for { meta: meta, source: source } in *posts[1, limit or #posts]] +cosmo = require "sitegen.cosmo" +html_renderer = require "sitegen.renderers.html" +html_renderer.cosmo_helpers.if = (args, has_block) => cosmo.cif args, has_block +html_renderer.cosmo_helpers.titleize = (slug) => html.build -> + titleize_slug(slug) if slug + sitegen.create => - @site_title = "WebDevCat.me · Catalin Mititiuc" + @site_title = "WebDevCat.me" @app_name = "stasis" @version = "0.2.12" @list_posts = list_posts - add "index.html" - add "blog.html", target: "posts/index", template: "blog" + add "index.html", title: "Catalin Mititiuc" + add "blog.html", title: "Posts", target: "posts/index", template: "blog" + + add "about.html", some: { + { one: "alpha", two: "beta" }, + { one: "A", two: "B" } + }, cif: cosmo.cif, math: math, x: 2 for path, target in pairs posts "docs" id = extract_id path @@ -101,7 +112,7 @@ sitegen.create => is_a: "post" publish_date: publish_date path id: id - titleize: (slug) -> html.build -> titleize_slug(slug) + -- titleize: (slug) -> html.build -> titleize_slug(slug) -- replace post markdown yaml headers with moonscript headers filter "docs", (body) => diff --git a/templates/root.html b/templates/root.html index e1294b2..3a05e7d 100644 --- a/templates/root.html +++ b/templates/root.html @@ -3,7 +3,7 @@ -