Skip to main content

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

VariableTypeDescription
annotationClassSuffixStringAdditional CSS class suffix for styling variants
titleHTMLThe title text/content of the annotated link
titleLinkClassStringCSS class(es) for the title link element
titleLinkHrefURLThe target URL for the title link
titleLinkDataAttributesHTMLCustom data attributes for the link (e.g., data-popup-type)
whichTabStringText description ("a new" or "this") for accessibility
tabOrWindowStringText ("tab" or "window") for accessibility
linkTargetStringHTML target attribute (_self, _blank, etc.)
authorDateAuxHTMLCombined author and date information
authorStringAuthor name (used in conditional logic)
abstractHTMLThe abstract/summary content
thumbnailFigureHTMLThumbnail image wrapped in <figure> element
fileIncludesHTMLAdditional 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:

  1. Author-date-aux class: Added to title paragraph if authorDateAux exists
  2. Separator colon: Shown after title if abstract/fileIncludes present AND no authorDateAux, OR after authorDateAux if abstract/fileIncludes present
  3. Thumbnail placement: Only appears inside blockquote when abstract exists
  4. File includes: Rendered inside blockquote if abstract present, outside otherwise

See Also