Polish
This commit is contained in:
parent
8497bbc092
commit
20477d99fb
@ -17,10 +17,12 @@ write_exec = (input, cmd, ...) ->
|
||||
|
||||
convert = =>
|
||||
(md_source) ->
|
||||
markup_filename = os.tmpname!
|
||||
write_exec md_source, @cmd, markup_filename
|
||||
Path.read_file markup_filename
|
||||
filename = os.tmpname!
|
||||
write_exec md_source, @cmd, filename
|
||||
Path.read_file filename
|
||||
|
||||
-- config command like this in site.moon:
|
||||
-- require("renderers.markdown").cmd = "pandoc --mathjax >"
|
||||
class PandocRenderer extends require "sitegen.renderers.markdown"
|
||||
unescape_cosmo = @unescape_cosmo
|
||||
escape_cosmo = @escape_cosmo
|
||||
|
16
site.moon
16
site.moon
@ -6,6 +6,7 @@ date = require "date"
|
||||
|
||||
import tag from html
|
||||
import escape_patt from require "sitegen.common"
|
||||
import p from require "moon"
|
||||
|
||||
-- Change output dir to what Openresty prefers
|
||||
Site.config.out_dir = "html/"
|
||||
@ -19,7 +20,9 @@ Site.default_renderers = for v in *Site.default_renderers
|
||||
if v\find "markdown" then continue else v
|
||||
|
||||
-- Add pandoc markdown renderer
|
||||
table.insert Site.default_renderers, "renderers.markdown"
|
||||
rend = "renderers.markdown"
|
||||
require(rend).cmd = "pandoc --mathjax >"
|
||||
table.insert Site.default_renderers, rend
|
||||
|
||||
-- https://github.com/leafo/sitegen/blob/v0.2/spec/sitegen_spec.moon#L9-L18
|
||||
get_files = (path, prefix=path) ->
|
||||
@ -59,15 +62,18 @@ list_posts = (page, limit) ->
|
||||
table.sort posts, (a, b) -> a.source > b.source
|
||||
|
||||
html.build ->
|
||||
[tag.section {
|
||||
tag.h3 { tag.a { href: meta.target .. ".html", meta.title or meta.id }}
|
||||
tag.time { publish_date source }
|
||||
import section, h3, a, time from tag
|
||||
|
||||
[section {
|
||||
h3 { a { href: meta.target .. ".html", meta.title or meta.id }}
|
||||
time { publish_date source }
|
||||
{ "—", if meta.blurb then html.builders.text! meta.blurb }
|
||||
tag.a { class: "read-post-link", href: meta.target .. ".html",
|
||||
a { class: "read-post-link", href: meta.target .. ".html",
|
||||
"Read post →"
|
||||
}
|
||||
} for { meta: meta, source: source } in *posts[1, limit or #posts]]
|
||||
|
||||
|
||||
sitegen.create =>
|
||||
@site_title = "WebDevCat.me · Catalin Mititiuc"
|
||||
@app_name = "stasis"
|
||||
|
Loading…
x
Reference in New Issue
Block a user