WIP: page titles
This commit is contained in:
parent
2a3f7f1e9e
commit
c8a1632902
@ -72,8 +72,6 @@ or
|
|||||||
|
|
||||||
## todo
|
## todo
|
||||||
|
|
||||||
* page titles
|
|
||||||
|
|
||||||
* draft documents
|
* draft documents
|
||||||
* treesitter highlighting for moonscript
|
* treesitter highlighting for moonscript
|
||||||
* penlight library
|
* penlight library
|
||||||
|
5
about.html
Normal file
5
about.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
$some[[<p>$one and then $two</p> ]]
|
||||||
|
|
||||||
|
$if{ true, target = 'World' }[[ Hello $target! ]], [[ Hi $target! ]]
|
||||||
|
|
||||||
|
$each{ { thing = "bye" }, { thing = "hello" } }[[$thing]]
|
19
site.moon
19
site.moon
@ -83,14 +83,25 @@ list_posts = (page, limit) ->
|
|||||||
}
|
}
|
||||||
} for { meta: meta, source: source } in *posts[1, limit or #posts]]
|
} 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 =>
|
sitegen.create =>
|
||||||
@site_title = "WebDevCat.me · Catalin Mititiuc"
|
@site_title = "WebDevCat.me"
|
||||||
@app_name = "stasis"
|
@app_name = "stasis"
|
||||||
@version = "0.2.12"
|
@version = "0.2.12"
|
||||||
@list_posts = list_posts
|
@list_posts = list_posts
|
||||||
|
|
||||||
add "index.html"
|
add "index.html", title: "Catalin Mititiuc"
|
||||||
add "blog.html", target: "posts/index", template: "blog"
|
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"
|
for path, target in pairs posts "docs"
|
||||||
id = extract_id path
|
id = extract_id path
|
||||||
@ -101,7 +112,7 @@ sitegen.create =>
|
|||||||
is_a: "post"
|
is_a: "post"
|
||||||
publish_date: publish_date path
|
publish_date: publish_date path
|
||||||
id: id
|
id: id
|
||||||
titleize: (slug) -> html.build -> titleize_slug(slug)
|
-- titleize: (slug) -> html.build -> titleize_slug(slug)
|
||||||
|
|
||||||
-- replace post markdown yaml headers with moonscript headers
|
-- replace post markdown yaml headers with moonscript headers
|
||||||
filter "docs", (body) =>
|
filter "docs", (body) =>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>$site_title$if{"title"}[[ — $title]]</title>
|
<title>$site_title$if{title or id}[[ · $(title or titleize(id))]]</title>
|
||||||
<link
|
<link
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
id="font-bitter-css"
|
id="font-bitter-css"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user