tweet-blockquote-not.tmpl
This template generates the HTML structure for displaying Twitter/X post content in popups and transclusions without using a element.
Read this when Use this page when tracing the HTML/Pandoc templates and include fragments that shape rendered gwern.net pages around tweet-blockquote-not.tmpl.
Overview
This template generates the HTML structure for displaying Twitter/X post content in popups and transclusions without using a <blockquote> element. Instead, it uses a semantic <div> wrapper, which is appropriate when the tweet is being presented as informational content rather than as a direct quotation.
The template creates a structured layout with author attribution, timestamp, and links, followed by the tweet content. It includes rich metadata such as link targets, icon metadata for styling, and archived URL references. The "not" variant (no blockquote) is registered as the popFrameTemplate in content.js's tweet content transform: it is used when a tweet is rendered inside a popup/popin, where the pop-frame itself already provides framing and citation context, so a blockquote wrapper would be redundant. The tweet-blockquote-outside variant is the default template for other contexts (e.g., in-page transclusion).
This template is filled entirely client-side: content.js fetches tweet content in the browser (via a Nitter mirror), and the template — bundled from template/include/ into transclude-templates-GENERATED.js by build/build_unified_assets.php — is populated by the transclude template system and displayed by extracts.js/transclude.js. (The Haskell side, Annotation.hs, only extracts the Twitter username for annotation metadata; it does not scrape tweet content.)
Template Variables
contentTypeClass- CSS class for content type styling (e.g.,content-transform-tweet)authorLinkClass- CSS class for the author link elementauthorLinkHref- URL to the author's Twitter/X profile (used only in the author link'stitleattribute; thehrefusestitleLinkHref)titleLinkHref- URL destination for the title link (often same as tweet URL)whichTab- Text describing tab behavior (e.g., "a new", "the same")tabOrWindow- Text "tab" or "window"linkTarget- HTML target attribute value (e.g.,_blank,_self)authorLinkIconMetadata- Data attributes for icon/avatar stylingauthorPlusAvatar- Author name with avatar imagetweetLinkClass- CSS class for the tweet timestamp linktweetLinkHref- URL to the specific tweetarchivedTweetURLDataAttribute- Data attribute containing archived tweet URLtweetLinkIconMetadata- Data attributes for link icon stylingtweetDate- Formatted date/time of the tweettweetContent- The main body content of the tweet
Output Structure
The template produces this structure:
<div class="content-transform [type-class]">
<p class="data-field tweet-links">
<a class="[author-class]"
title="Open <author-url> in [which] [tab/window]"
href="[title-url]"
target="[target]"
[icon-metadata]
>[author+avatar]</a> on <a
class="[tweet-class]"
title="Open <tweet-url> in [which] [tab/window]"
href="[tweet-url]"
[archived-url-data]
[icon-metadata]
>[date]</a>
</p>
<div class="data-field tweet-content">[tweet body]</div>
</div>
The layout emphasizes attribution (author and timestamp links) followed by content. The data-field classes enable JavaScript targeting for dynamic behavior like link rewriting or content updates.
Template caveats: The author link currently uses titleLinkHref (not authorLinkHref). The tweet link title placeholder in the template is malformed (<<{tweetLinkHref>>), so it does not interpolate as documented.
See Also
- tweet-blockquote-outside.tmpl - Variant with blockquote wrapper for citation contexts
- annotation-blockquote-not.tmpl - Similar "no-blockquote" pattern for annotations
- Annotation.hs - Scrapes tweet metadata and content from Twitter/X
- LinkMetadata.hs - Manages annotation database and metadata
- extracts.js - Displays popup/transclude content
- popups.js - Popup positioning and rendering
- content.js - Content type routing and template selection