Skip to main content

tweet-blockquote-not.tmpl

This template generates the HTML structure for displaying Twitter/X post content in popups and transclusions without using a element.

Pathtemplate/include/tweet-blockquote-not.tmpl
LanguageHTML5/Pandoc
Lines20

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 element
  • authorLinkHref - URL to the author's Twitter/X profile (used only in the author link's title attribute; the href uses titleLinkHref)
  • 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 styling
  • authorPlusAvatar - Author name with avatar image
  • tweetLinkClass - CSS class for the tweet timestamp link
  • tweetLinkHref - URL to the specific tweet
  • archivedTweetURLDataAttribute - Data attribute containing archived tweet URL
  • tweetLinkIconMetadata - Data attributes for link icon styling
  • tweetDate - Formatted date/time of the tweet
  • tweetContent - 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