diff --git a/app.css b/app.css index c623dc3..65dd0db 100644 --- a/app.css +++ b/app.css @@ -173,7 +173,13 @@ main { } /* Overrule pandoc style */ -div.sourceCode { margin: inherit; } +div.sourceCode { + margin: inherit; +} + +div.sourceCode, div.highlight { + border-radius: 3px; +} main * { text-align: left; @@ -309,17 +315,10 @@ figure figcaption { } pre { - /* background-color: aliceblue; */ padding: 1em; - border: 1px solid lightgray; - border-radius: 3px; overflow: auto; } -:not(pre) > code { - background-color: rgb(230, 232, 245); -} - .code-filename-label, .filename-for-code-block > p { font-weight: bold; margin-bottom: 0; diff --git a/site.moon b/site.moon index bfb6f6f..2339c46 100644 --- a/site.moon +++ b/site.moon @@ -56,9 +56,7 @@ format_date = (str) -> date(str)\fmt "%b %d, %Y" strip_date = (filename) -> filename\gsub "#{escape_patt(extract_date(filename) .. "-")}/?", "" -publish_date = (path using extract_date, format_date) -> - date = extract_date path - date, format_date date +publish_date = (dt using format_date) -> { pretty: format_date(dt), iso: dt } target = (path, prefix=".") -> filename = rootname last common.split path, "/" @@ -98,7 +96,7 @@ sitegen.create => md = @site\get_renderer "sitegen.renderers.markdown" return for post in *posts - {:title, :blurb, :id, publish_date: {iso, pretty}} = post.meta + {:title, :blurb, :id, :publish_date} = post.meta url = rootname post\url_for! if blurb @@ -107,30 +105,34 @@ sitegen.create => section { h3 { a { title or titleize_slug(id), href: url }} - time { pretty, datetime: iso } + time { publish_date.pretty, datetime: publish_date.iso } "—", blurb, a { "Read post →", class: "read-post-link", href: url } } add_all = (files) -> - add path, { - target: target path, "/posts" - template: "post" - is_a: "post" - publish_date: { publish_date path } - id: extract_id path - } for path in *files + for path in *files + add path, { + target: target path, "/posts" + template: "post" + is_a: "post" + publish_date: publish_date extract_date path + id: extract_id path + } add "index.html", title: "Catalin Mititiuc" add "blog.html", title: "Posts", target: "posts/index", template: "blog" + add "example.moon.md", template: "post" title: "MoonScript Example" - publish_date: format_date date true + publish_date: publish_date date true + add "code.md", template: "post" title: "Code Syntax Highlight Samples" - publish_date: format_date date true - -- add_all files_from "docs" + publish_date: publish_date date true + + add_all files_from "docs" copy "app.css" copy "pygments.css" diff --git a/templates/post.html b/templates/post.html index 3d8a237..efe6473 100644 --- a/templates/post.html +++ b/templates/post.html @@ -4,7 +4,7 @@ $wrap{"blog"}

$(title or titleize(id))

- +