diff --git a/lib/html/header-material.js b/lib/html/header-material.js index e2939ba..e595ef6 100644 --- a/lib/html/header-material.js +++ b/lib/html/header-material.js @@ -87,6 +87,16 @@ export default async function run (doc, opt, ctx) { }); } else ctx.error(`Frontmatter must have an editors field.`); + if (opt.relatedIssues) { + metaEls.push(el('dt', {}, [`Related Issue${opt.relatedIssues.length > 1 ? 's' : ''}`])); + opt.relatedIssues.forEach(urlStr => { + let url = new URL(urlStr); + let name = url.hostname + url.pathname; + if (url.hostname == 'github.com') name = url.pathname; + if (name.startsWith('/')) name = name.substring(1); + metaEls.push(el('dd', {}, [el('a', { href: url.toString() }, [name])])); + }) + } const dl = metaEls.length ? el('dl', null, metaEls) : null; const abstractContent = []; let nxt = h1;