Skip to content

Commit cc2e615

Browse files
authored
Emit a <link rel="alternate"> for the markdown version of a page (#3528)
1 parent a862cde commit cc2e615

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/rude-tomatoes-hunt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": minor
3+
---
4+
5+
Emit a <link rel="alternate"> for the markdown version of a page

packages/gitbook/src/components/SitePage/SitePage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ export async function generateSitePageMetadata(props: SitePageProps): Promise<Me
135135
canonical: linker
136136
.toAbsoluteURL(linker.toPathForPage({ pages: revision.pages, page }))
137137
.replace(/\/+$/, ''),
138+
types: {
139+
'text/markdown': `${linker.toAbsoluteURL(linker.toPathInSpace(page.path))}.md`,
140+
},
138141
},
139142
openGraph: {
140143
images: [

0 commit comments

Comments
 (0)