Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Entry Emulator - support dateline in topic page header #2868

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions db/model/Gdoc/htmlToEnriched.ts
Original file line number Diff line number Diff line change
Expand Up @@ -846,23 +846,7 @@ function cheerioToArchieML(
.with({ tagName: "details" }, unwrapElementWithContext)
.with({ tagName: "div" }, (div) => {
const className = div.attribs.class || ""
// Special handling for a div that we use to mark the "First published on..." notice
if (className.includes("blog-info")) {
const children = unwrapElementWithContext(div)
const textChildren = children.content.filter(
(c) => "type" in c && c.type === "text"
) as EnrichedBlockText[]
const callout: EnrichedBlockCallout = {
type: "callout",
title: "",
text: textChildren,
parseErrors: [],
}
return {
errors: [],
content: [callout],
}
} else if (className.includes("pcrm")) {
if (className.includes("pcrm")) {
// pcrm stands for "preliminary collection of relevant material" which was used to designate entries
// that weren't fully polished, but then became a way to create a general-purpose "warning box".
const unwrapped = unwrapElementWithContext(element)
Expand Down
3 changes: 3 additions & 0 deletions site/gdocs/OwidGdocHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ function OwidTopicPageHeader({
})}
</a>
</p>
<p className="topic-page-header__dateline body-3-medium-italic col-start-2 span-cols-8">
{content.dateline}
</p>
</header>
)
}
Expand Down
9 changes: 8 additions & 1 deletion site/gdocs/topic-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,17 @@
p.topic-page-header__byline,
.topic-page-header__byline a {
color: $blue-60;
margin-bottom: 0;
@include sm-only {
font-size: 0.875rem;
}
}

// Applies to either .topic-page-header__byline or .topic-page-header__dateline, if specified
p:last-child {
margin-bottom: 34px;
@include sm-only {
margin-bottom: 16px;
font-size: 0.875rem;
}
}

Expand Down
Loading