diff --git a/docs/websites/website-listings-custom.qmd b/docs/websites/website-listings-custom.qmd index 47667ee805..98aca78353 100644 --- a/docs/websites/website-listings-custom.qmd +++ b/docs/websites/website-listings-custom.qmd @@ -8,8 +8,7 @@ In addition to the 3 built in types of listings, you can also build a completely ## Listing Templates -To build a custom listing display, you create an [EJS template](https://ejs.co) that will be used to generate the HTML for a set of items that are passed to the template. EJS templates allow you to generate HTML using plain javascript, making it easy to loop through items and output their values in your custom HTML. - +To build a custom listing display, you create an [EJS template](https://ejs.co) that will be used to generate the HTML for a set of items that are passed to the template. EJS templates allow you to generate HTML using plain JavaScript, making it easy to loop through items and output their values in your custom HTML. To use a custom template, pass it in the `template` option for a listing: @@ -26,15 +25,17 @@ listing: template: gallery.ejs ``` -A simple template for outputing a list of documents might look like: +A simple template for outputting a list of documents might look like: -``` html +````markdown +```{=html} ``` +```` which produces simple HTML output like: @@ -42,6 +43,22 @@ which produces simple HTML output like: When rendered, the above template will receive an array of listing items called `items`. When the contents of a listing are loaded from a list of documents, each of those items will be populated with the fields described in [Listing Fields](website-listings.qmd#listing-fields). In addition, any other fields included in a documents metadata will be passed as a property of the item, making it possible to use custom metadata in your documents and the listing display. +Because the EJS templates are processed by Quarto, the templates are intrinsically Markdown documents. +For example, if you want your listing `title` (*e.g.*, `My **bold** title`) to support Markdown formatting, you need to change the above simple template into: + +````markdown +```{=html} + +``` +```` + ::: {.callout-note} Note that Quarto uses `lodash` to render the EJS templates. The `lodash` uses different syntax for HTML escaping text in templates. @@ -71,7 +88,7 @@ listing: could be rendered using: -```` html +````markdown ```{=html}