annotation-blockquote-inside.tmpl
Path: template/include/annotation-blockquote-inside.tmpl | Language: HTML5/Pandoc | Lines: ~27
Template for rendering annotations where the abstract blockquote follows the title paragraph.
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 layout is generated by the Haskell build system (particularly Annotation.hs and LinkMetadata.hs) based on the annotation data structure and rendering context determined during compilation.
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 description ("a new" or "this") for accessibility |
tabOrWindow | String | Text ("tab" or "window") for accessibility |
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 Hakyll's conditional syntax:
<[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/popin rendering
- extracts-annotations.js - Frontend annotation type handling
- Annotation.hs - Backend scraping and processing of annotation metadata
- LinkMetadata.hs - Backend metadata database management