tweet-blockquote-outside.tmpl
This template generates the HTML structure for displaying Twitter/X post content in popups and transclusions with a element wrapping the entire content.
Read this when Use this page when tracing the HTML/Pandoc templates and include fragments that shape rendered gwern.net pages around tweet-blockquote-outside.tmpl.
Overview
This template generates the HTML structure for displaying Twitter/X post content with a <blockquote> element wrapping the entire content. This variant is registered as the default template in content.js's tweet content transform, used when the tweet is presented as quoted material outside a pop-frame (e.g., transcluded into a page); the tweet-blockquote-not variant is the popFrameTemplate used inside popups/popovers.
The structure is nearly identical to tweet-blockquote-not.tmpl, but the outer wrapper is a <blockquote> instead of a <div>. This subtle difference affects both semantic meaning (for accessibility and SEO) and default browser styling. The template includes rich metadata for author attribution, timestamps, link targets, and archived URLs.
The "outside" designation indicates that the blockquote wraps the entire content container, including both the attribution line and the tweet body. Like the other template/include/*.tmpl fragments, it is bundled into transclude-templates-GENERATED.js by build/build_unified_assets.php and filled client-side by the JavaScript transclude template system (content.js fetches the tweet content in the browser via a Nitter mirror).
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 profilewhichTab- 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:
<blockquote class="content-transform [type-class]">
<p class="data-field tweet-links">
<a class="[author-class]"
title="Open <author-url> in [which] [tab/window]"
href="[author-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>
</blockquote>
The <blockquote> wrapper provides citation semantics. Inside, the structure mirrors the non-blockquote variant: attribution metadata in a <p> tag followed by tweet content in a <div>.
Template caveat: The tweet link title attribute uses a malformed placeholder (<<{tweetLinkHref>>), so the tweet URL is not interpolated as shown in the example.
See Also
- tweet-blockquote-not.tmpl - Variant without blockquote wrapper
- annotation-blockquote-not.tmpl - Similar 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