import mustache from "mustache"; import {Template} from "../mixins/template"; import {page} from "./layout"; const T = Template("d-byline", ` `, false); const mustacheTemplate = `
{{#authors}}
{{#personalURL}} {{name}} {{/personalURL}} {{^personalURL}}
{{name}}
{{/personalURL}} {{#affiliation}} {{#affiliationURL}} {{affiliation}} {{/affiliationURL}} {{^affiliationURL}}
{{affiliation}}
{{/affiliationURL}} {{/affiliation}}
{{/authors}}
{{publishedMonth}}. {{publishedDay}}
{{publishedYear}}
Citation:
{{concatenatedAuthors}}, {{publishedYear}}
`; export default class Byline extends T(HTMLElement) { static get is() { return "d-byline"; } render(data) { this.innerHTML = mustache.render(mustacheTemplate, data); } } customElements.define(Byline.is, Byline);