Skip to main content

annotation-blockquote-outside.tmpl

Path: template/include/annotation-blockquote-outside.tmpl | Language: HTML5/Pandoc | Lines: ~22

Template for rendering annotations with a blockquote element wrapping the entire annotation.

Overview

This template produces an annotation layout where the entire annotation content - including title, author/date, abstract, thumbnail, and file includes - is wrapped within a single <blockquote> element. This creates a visual and semantic treatment that emphasizes the annotation as a quotation or external reference distinct from the main page content.

The template is part of gwern.net's annotation system, which provides rich metadata and abstracts for external links. The "blockquote-outside" variant is used when the entire annotation should be presented as quoted or externally-sourced material, with the blockquote element providing both semantic markup and distinctive visual styling.

This layout is generated by the Haskell build system (particularly Annotation.hs and LinkMetadata.hs) based on the annotation data structure and rendering context. It's structurally identical to the "blockquote-not" variant except for the outermost container element.

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
abstractHTMLThe abstract/summary content
thumbnailFigureHTMLThumbnail image wrapped in <figure> element
fileIncludesHTMLAdditional file/attachment information

Output Structure

The template generates a flat structure wrapped in a blockquote:

<blockquote class="annotation[suffix]">
[optional thumbnail figure]

<p class="data-field title">
<a class="..." href="..." target="..." data-...>Title</a>
</p>

<!-- If authorDateAux exists: -->
<p class="data-field author-date-aux">[author and date info]</p>

<!-- If abstract exists: -->
<div class="data-field annotation-abstract">[abstract content]</div>

<!-- If fileIncludes exists: -->
<div class="data-field file-includes">[file information]</div>
</blockquote>

Key structural features:

  • Blockquote wraps everything: The outermost container is <blockquote> instead of <div>
  • Flat inner hierarchy: All content elements (title, author/date, abstract, file-includes) are siblings
  • Thumbnail placement: Appears as first child if present
  • Separate paragraphs: Author/date information gets its own <p> element
  • Annotation class on blockquote: The annotation class is applied to the blockquote itself

Conditional Logic

The template uses Hakyll's conditional syntax:

  • <[IF condition]>...<[IFEND]> - First-level conditional

Applied to:

  1. Thumbnail figure: Rendered first if present
  2. Author-date-aux: Gets dedicated paragraph if present
  3. Abstract: Rendered in div if present
  4. File includes: Rendered in div if present

All conditionals are independent - each field is checked and rendered separately.

Semantic Implications

Using a <blockquote> as the outermost wrapper has several implications:

  • Semantic HTML: Indicates content is quoted or referenced from an external source
  • Screen readers: Will announce this as quoted content to assistive technology users
  • Default styling: Browsers apply default indentation/styling to blockquotes
  • CSS targeting: Allows different styling via the blockquote.annotation selector

This makes the template appropriate for contexts where annotations should be visually and semantically distinguished as external references, such as in annotation popups or dedicated reference sections.

Comparison with Other Variants

  • vs. blockquote-inside: Wraps entire annotation rather than just the abstract
  • vs. blockquote-not: Identical structure except outer container is <blockquote> vs <div>
  • vs. partial-inline: Includes all annotation fields rather than just title/author

See Also