diff --git a/functions/_common/grapherRenderer.ts b/functions/_common/grapherRenderer.ts index 58605d60a61..ce694861974 100644 --- a/functions/_common/grapherRenderer.ts +++ b/functions/_common/grapherRenderer.ts @@ -360,14 +360,22 @@ export async function fetchMetadataForGrapher( undefined ) + const titleShort = col.titlePublicOrDisplayName.title + const attributionShort = col.titlePublicOrDisplayName.attributionShort + const titleVariant = col.titlePublicOrDisplayName.titleVariant + const attributionString = + attributionShort && titleVariant + ? `${attributionShort} – ${titleVariant}` + : attributionShort || titleVariant + const titleModifier = attributionString ? ` - ${attributionString}` : "" + const titleLong = `${col.titlePublicOrDisplayName.title}${titleModifier}` + return [ useShortNames ? shortName : col.name, { - title: col.titlePublicOrDisplayName.title, - titleProducer: col.titlePublicOrDisplayName.attributionShort, - titleVariant: col.titlePublicOrDisplayName.titleVariant, + titleShort, + titleLong, descriptionShort, - descriptionFromProducer, descriptionKey, descriptionProcessing, shortUnit, @@ -377,14 +385,13 @@ export async function fetchMetadataForGrapher( type, conversionFactor: col.display?.conversionFactor, owidVariableId, - catalogPath, - sources: consensedOrigins, shortName, additionalInfo, lastUpdated, nextUpdate, citationShort, citationLong, + fullMetadata: `https://api.ourworldindata.org/v1/indicators/${owidVariableId}.metadata.json`, }, ] }) diff --git a/functions/_common/readmeTools.ts b/functions/_common/readmeTools.ts index d56200fa6b5..2ea9ec5468c 100644 --- a/functions/_common/readmeTools.ts +++ b/functions/_common/readmeTools.ts @@ -153,24 +153,6 @@ export function* getSources( if (source.retrievedFrom) yield `Retrieved from: ${source.retrievedFrom.trim()}` + markdownNewlineEnding - if (source.description) { - yield "" - yield "##### Description of the dataset" - yield* yieldMultilineTextAsLines(source.description).map( - (l) => `> ${l}` - ) - yield "" - } - if (source.citation) { - yield "" - yield "##### Citation" - yield "This is the citation of the original data obtained from the source, prior to any processing or adaptation by Our World in Data. We would usually prefer to use the Our World In Data citation format given at the bottom." + - markdownNewlineEnding - yield* yieldMultilineTextAsLines(source.citation).map( - (l) => `> ${l}` - ) - yield "" - } } } @@ -234,6 +216,9 @@ function* columnReadmeText(col: CoreColumn) { const attribution = getAttribution(def) const source = getSource(attribution, def) + + yield* getCitationLines(def, col) + yield `Source: ${source}` yield* getDescriptionLines(def, attribution) @@ -241,8 +226,6 @@ function* columnReadmeText(col: CoreColumn) { yield* getSources(def) yield* getDataProcessingLines(def) - - yield* getCitationLines(def, col) yield "" }