_includes/layouts/articles.11ty.js

/**
* @file Defines the chained template for journal articles
* @author Reuben L. Lillie <reubenlillie@gmail.com>
* @see {@link https://www.11ty.dev/docs/layouts/#layout-chaining Layout chaining in 11ty}
*/


/**
* Acts as front matter in JavaScript templates.
*/

exports.data = {
layout: 'layouts/content'
}

/**
* The content of the template
* @method
* @name render()
* @param {Object} data 11ty’s data object
* @return {String} HTML template literal
* @see {@link https://www.11ty.dev/docs/shortcodes/ Shortcodes in 11ty}
*/

exports.render = function (data) {
return `<p>Here’s a sample of my published journal articles.</p>
<p>You can find full text copies, abstacts, and other information on <a href="https://olivet.academia.edu/ReubenLillie">Academia.edu</a>.</p>
<p><em>Arranged by date</em></p>
<ul class="hanging-indent no-list-style">
${data.writing.articles.map(article => `<li>
${article.author ? `${article.author}.` : ''}
${article.title ? `${article.title}.”` : ''}
${article.periodical ? `<em>${article.periodical}</em>` : ''}
${article.volume ? `${article.volume},` : ''}
${article.issue ? `no. ${article.issue}` : ''}
${article.date ? `(${article.date}):` : ''}
${article.url ? `<a href="${article.url}">${article.url}</a>.` : ''}
</li>
`

).join('')}

</ul>
`

}