annotation-blockquote-inside.tmpl
This template produces a specialized annotation layout used when the annotation content needs to be rendered with the abstract contained within a element that follows the title.
Read this when Use this page when tracing the HTML/Pandoc templates and include fragments that shape rendered gwern.net pages around annotation-blockquote-inside.tmpl.
Overview
This template produces a specialized annotation layout used when the annotation content needs to be rendered with the abstract contained within a <blockquote> element that follows the title paragraph. This creates a visual hierarchy where the title and metadata flow directly into the abstract without visual separation.
The template is part of gwern.net's annotation system, which provides rich metadata and abstracts for external links. The "blockquote-inside" variant uses a blockquote immediately after the title paragraph to keep the abstract tightly coupled to the title/metadata.
This template is not rendered by the Haskell build system. All template/include/*.tmpl files are bundled into js/transclude-templates-GENERATED.js by build/build_unified_assets.php, and filled at runtime in the browser by the JavaScript transclusion system (fillTemplate() in transclude.js). This variant is the default template for annotations transcluded into page content (annotations.js sets template: "annotation-blockquote-inside" in its reference data); pop-frames use annotation-blockquote-not instead, via the popFrameTemplate field.
Template Variables
| Variable | Type | Description |
|---|---|---|
annotationClassSuffix | String | Additional CSS class suffix for styling variants |
title | HTML | The title text/content of the annotated link |
titleLinkClass | String | CSS class(es) for the title link element |
titleLinkHref | URL | The target URL for the title link |
titleLinkDataAttributes | HTML | Custom data attributes for the link (e.g., data-popup-type) |
whichTab | String | Text ("new" on desktop, "current" on mobile) for the link tooltip |
tabOrWindow | String | Text ("window" on desktop, "tab" on mobile) for the link tooltip |
linkTarget | String | HTML target attribute (_self, _blank, etc.) |
authorDateAux | HTML | Combined author and date information |
author | String | Author name (used in conditional logic) |
abstract | HTML | The abstract/summary content |
thumbnailFigure | HTML | Thumbnail image wrapped in <figure> element |
fileIncludes | HTML | Additional file/attachment information |
Output Structure
The template generates a two-block structure:
<div class="annotation[suffix]">
<p class="data-field title [author-date-aux]">
<a class="..." href="..." target="..." data-...>Title</a>
[: separator if abstract/fileIncludes present]
[, author-date-aux info][: separator if abstract/fileIncludes]
</p>
<!-- If abstract exists: -->
<blockquote class="data-field annotation-abstract">
[optional thumbnail figure]
[abstract content]
[optional file-includes div]
</blockquote>
<!-- If no abstract but fileIncludes: -->
[optional file-includes div]
</div>
Key structural features:
- Title and metadata in single paragraph: The title link and author/date information share a
<p>element - Conditional punctuation: Colons and commas are inserted based on what fields are present
- Blockquote for abstract: When present, the abstract is wrapped in
<blockquote>with thumbnail and file-includes nested inside - Fallback structure: File includes appear outside blockquote if there's no abstract
Conditional Logic
The template uses the conditional syntax of the JavaScript template system (implemented by fillTemplate() in transclude.js — not Hakyll):
<[IF condition]>...<[IFEND]>- First-level conditional<[IF2 condition]>...<[IF2END]>- Nested conditional[ field1 | field2 ]- Logical OR for field presence&- Logical AND!- Logical NOT
Notable conditions:
- Author-date-aux class: Added to title paragraph if
authorDateAuxexists - Separator colon: Shown after title if abstract/fileIncludes present AND no authorDateAux, OR after authorDateAux if abstract/fileIncludes present
- Thumbnail placement: Only appears inside blockquote when abstract exists
- File includes: Rendered inside blockquote if abstract present, outside otherwise
See Also
- annotation-blockquote-outside.tmpl - Variant with blockquote wrapping entire annotation
- pop-frame-title-standard.tmpl - Template for popup title bar
- popups.js - Frontend popup system that displays annotations
- extracts.js - Frontend coordinator for popup/popover rendering
- extracts-annotations.js - Frontend annotation type handling
- Annotation.hs - Backend scraping and processing of annotation metadata
- LinkMetadata.hs - Backend metadata database management