+++ /dev/null
-let assert = require('assert')
-
-return async (env, head, body, scripts) => {
- let breadcrumbs = await _require('/_lib/breadcrumbs.jst')
- let navbar = await _require('/_lib/navbar.jst')
-
- await navbar(
- env,
- head,
- // body
- async _out => {
- await breadcrumbs(env, _out)
-
- // extract second-level directory name
- assert(env.parsed_url.pathname.slice(0, 6) === '/blog/')
- let index = env.parsed_url.pathname.indexOf('/', 6)
- let dir = index === -1 ? '' : env.parsed_url.pathname.slice(6, index)
-
- // load article data
- let menu = await env.site.get_menu('/blog/_menu.json')
- let article = menu.entries[menu.index[dir]]
-
- div.row.mb-3 {
- div.col-sm-12 {
- img.img-responsive(src=article.image || 'image.jpg') {}
- }
- }
-
- h3 {`${article.description}—by ${article.author}`}
-
- await body(_out)
- },
- scripts
- )
-}