Skip to main content

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.

Pathtemplate/include/annotation-blockquote-inside.tmpl
LanguageHTML5/Pandoc
Lines28

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

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 ("new" on desktop, "current" on mobile) for the link tooltip
tabOrWindowStringText ("window" on desktop, "tab" on mobile) for the link tooltip
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 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:

  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