Skip to content

Commit

Permalink
🔨 remove logic for images in faqs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Apr 4, 2024
1 parent 4493172 commit 7b08666
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
14 changes: 1 addition & 13 deletions baker/GrapherBaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import {
keyBy,
mergePartialGrapherConfigs,
compact,
merge,
partition,
traverseEnrichedBlock,
} from "@ourworldindata/utils"
import fs from "fs-extra"
import * as lodash from "lodash"
Expand All @@ -39,13 +37,11 @@ import {
DimensionProperty,
OwidVariableWithSource,
OwidChartDimensionInterface,
OwidGdocPostInterface,
EnrichedFaq,
FaqEntryData,
FaqDictionary,
ImageMetadata,
OwidGdocBaseInterface,
OwidGdocMinimalPostInterface,
} from "@ourworldindata/types"
import ProgressBar from "progress"
import {
Expand All @@ -64,7 +60,6 @@ import { knexRaw } from "../db/db.js"
import { getRelatedChartsForVariable } from "../db/model/Chart.js"
import pMap from "p-map"
import { getGdocBaseObjectBySlug } from "../db/model/Gdoc/GdocFactory.js"
import { extractFilenamesFromBlock } from "../db/model/Gdoc/gdocUtils.js"

const renderDatapageIfApplicable = async (
grapher: GrapherInterface,
Expand Down Expand Up @@ -295,16 +290,9 @@ export async function renderDataPageV2(
.map((r) => r.imageUrl)
.filter((f): f is string => !!f)

const faqEntryFilenames: string[] = []
faqEntries.faqs.forEach((f) => {
traverseEnrichedBlock(f, (block) => {
faqEntryFilenames.push(...extractFilenamesFromBlock(block))
})
})

const imageMetadata = lodash.pick(
imageMetadataDictionary,
uniq([...relatedResearchFilenames, ...faqEntryFilenames])
uniq(relatedResearchFilenames)
)

const tagToSlugMap = await getTagToSlugMap(knex)
Expand Down
1 change: 0 additions & 1 deletion packages/@ourworldindata/types/src/gdocTypes/Datapage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "../OwidVariable.js"
import { RelatedChart } from "../grapherTypes/GrapherTypes.js"
import { Static, Type } from "@sinclair/typebox"
import { OwidGdocPostInterface } from "./Gdoc.js"
import { OwidEnrichedGdocBlock } from "./ArchieMlComponents.js"
import { ImageMetadata } from "./Image.js"

Expand Down

0 comments on commit 7b08666

Please sign in to comment.