UNPKG

@magic/core

Version:

@magic core. generate static pages and serverless lambdas. ~5kb client boilerplate.

18 lines (15 loc) 362 B
export const View = state => { const { link, year, blog, url } = state let to if (link) { to = `${link}${year}/` } else if (url.endsWith(`${year}/`)) { to = url } return div([ h2(link ? Link({ to }, year) : year), Object.entries(blog[year]).map(([month, days]) => BlogMonth({ ...state, month, days, link: to }), ), ]) }