Skip to content
Merged
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
2 changes: 1 addition & 1 deletion components/context/ArticleContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '',
Expand Down
2 changes: 1 addition & 1 deletion components/context/AutomatedPageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 || [],
Expand Down
6 changes: 3 additions & 3 deletions components/context/TocLandingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type TocItem = {

export type TocLandingContextT = {
title: string
introPlainText: string
intro: string
productCallout: string
tocItems: Array<TocItem>
variant?: 'compact' | 'expanded'
Expand All @@ -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'])
),
Expand Down
4 changes: 2 additions & 2 deletions components/landing/TocLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const TocLanding = () => {
const router = useRouter()
const {
title,
introPlainText,
intro,
tocItems,
productCallout,
variant,
Expand All @@ -39,7 +39,7 @@ export const TocLanding = () => {
<ArticleGridLayout>
<ArticleTitle>{title}</ArticleTitle>

{introPlainText && <Lead data-search="lead">{introPlainText}</Lead>}
{intro && <Lead data-search="lead">{intro}</Lead>}

{productCallout && (
<Callout variant="success" dangerouslySetInnerHTML={{ __html: productCallout }} />
Expand Down
4 changes: 0 additions & 4 deletions lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion middleware/render-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default async function renderPage(req, res) {
if (isConnectionDropped(req, res)) return

// Create string for <title> 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)) {
Expand Down