Skip to content

Commit

Permalink
✨ add GdocMinimalPostInterface rationale
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Jan 18, 2024
1 parent 8ae533e commit dbc9dcd
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/@ourworldindata/types/src/gdocTypes/Gdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,20 @@ export interface OwidGdocBaseInterface {

export interface OwidGdocPostInterface extends OwidGdocBaseInterface {
content: OwidGdocPostContent
linkedDocuments?: Record<string, OwidGdocMinimalPostInterface>
}

// Used for linkedDocuments attachments, instead of attaching the entire gdoc model
export interface OwidGdocMinimalPostInterface {
id: string
title: string
title: string // used in prominent links, topic-page-intro related topics, etc
slug: string
authors: string[]
publishedAt: string
published: boolean
subtitle: string
excerpt: string
type: OwidGdocType
"featured-image"?: string
authors: string[] // used in research & writing block
publishedAt: string // used in research & writing block
published: boolean // used in preview to validate whether or not the post will display
subtitle: string // used in prominent links & research & writing block
excerpt: string // used in prominent links
type: OwidGdocType // used in useLinkedDocument to prepend /data-insights/ to the slug
"featured-image"?: string // used in prominent links and research & writing block
}

export interface OwidGdocDataInsightContent {
Expand All @@ -84,7 +83,6 @@ export const DATA_INSIGHTS_INDEX_PAGE_SIZE = 20

export interface OwidGdocDataInsightInterface extends OwidGdocBaseInterface {
content: OwidGdocDataInsightContent
linkedDocuments?: Record<string, OwidGdocMinimalPostInterface>
latestDataInsights?: MinimalDataInsightInterface[]
tags?: Tag[]
}
Expand Down

0 comments on commit dbc9dcd

Please sign in to comment.