diff --git a/components/context/ArticleContext.tsx b/components/context/ArticleContext.tsx index 145b837708..324cd01c86 100644 --- a/components/context/ArticleContext.tsx +++ b/components/context/ArticleContext.tsx @@ -62,7 +62,7 @@ export const getArticleContextFromRequest = (req: any): ArticleContextT => { } return { - title: page.titlePlainText, + title: page.title, intro: page.intro, effectiveDate: page.effectiveDate || '', renderedPage: req.context.renderedPage || '', diff --git a/components/context/AutomatedPageContext.tsx b/components/context/AutomatedPageContext.tsx index 1810027294..79a0093a73 100644 --- a/components/context/AutomatedPageContext.tsx +++ b/components/context/AutomatedPageContext.tsx @@ -28,7 +28,7 @@ export const getAutomatedPageContextFromRequest = (req: any): AutomatedPageConte const page = req.context.page return { - title: page.titlePlainText, + title: page.title, intro: page.intro, renderedPage: req.context.renderedPage || '', miniTocItems: req.context.miniTocItems || [], diff --git a/components/context/TocLandingContext.tsx b/components/context/TocLandingContext.tsx index 8fe21595ec..054134e03d 100644 --- a/components/context/TocLandingContext.tsx +++ b/components/context/TocLandingContext.tsx @@ -11,7 +11,7 @@ export type TocItem = { export type TocLandingContextT = { title: string - introPlainText: string + intro: string productCallout: string tocItems: Array variant?: 'compact' | 'expanded' @@ -34,9 +34,9 @@ export const useTocLandingContext = (): TocLandingContextT => { export const getTocLandingContextFromRequest = (req: any): TocLandingContextT => { return { - title: req.context.page.titlePlainText, + title: req.context.page.title, productCallout: req.context.page.product || '', - introPlainText: req.context.page.introPlainText, + intro: req.context.page.intro, tocItems: (req.context.genericTocFlat || req.context.genericTocNested || []).map((obj: any) => pick(obj, ['fullPath', 'title', 'intro', 'childTocItems']) ), diff --git a/components/landing/TocLanding.tsx b/components/landing/TocLanding.tsx index 3058c079eb..cfa4349f4d 100644 --- a/components/landing/TocLanding.tsx +++ b/components/landing/TocLanding.tsx @@ -18,7 +18,7 @@ export const TocLanding = () => { const router = useRouter() const { title, - introPlainText, + intro, tocItems, productCallout, variant, @@ -39,7 +39,7 @@ export const TocLanding = () => { {title} - {introPlainText && {introPlainText}} + {intro && {intro}} {productCallout && ( diff --git a/lib/page.js b/lib/page.js index 75cac9b6d4..5fc94efb21 100644 --- a/lib/page.js +++ b/lib/page.js @@ -178,10 +178,6 @@ class Page { }) this.title = await renderContentWithFallback(this, 'rawTitle', context, { textOnly: true, - encodeEntities: true, - }) - this.titlePlainText = await renderContentWithFallback(this, 'rawTitle', context, { - textOnly: true, }) this.shortTitle = await renderContentWithFallback(this, 'shortTitle', context, { textOnly: true, diff --git a/middleware/render-page.js b/middleware/render-page.js index 6a65e9ba99..98a14dd80d 100644 --- a/middleware/render-page.js +++ b/middleware/render-page.js @@ -81,7 +81,7 @@ export default async function renderPage(req, res) { if (isConnectionDropped(req, res)) return // Create string for tag - page.fullTitle = page.titlePlainText + page.fullTitle = page.title // add localized ` - GitHub Docs` suffix to <title> tag (except for the homepage) if (!patterns.homepagePath.test(path)) {