Skip to content

Commit 70e24d3

Browse files
committed
feat: display og images in social media
1 parent c6e8099 commit 70e24d3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/generators/legacy-html-all/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default {
8585
const generatedAllTemplate = apiTemplate
8686
.replace('__ID__', 'all')
8787
.replace(/__FILENAME__/g, 'all')
88-
.replace('__SECTION__', 'All')
88+
.replace(/__SECTION__/g, 'All')
8989
.replace(/__VERSION__/g, `v${version.toString()}`)
9090
.replace(/__TOC__/g, tableOfContents.wrapToC(aggregatedToC))
9191
.replace(/__GTOC__/g, parsedSideNav)

src/generators/legacy-html/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default {
8888
return apiTemplate
8989
.replace('__ID__', api)
9090
.replace(/__FILENAME__/g, api)
91-
.replace('__SECTION__', section)
91+
.replace(/__SECTION__/g, section)
9292
.replace(/__VERSION__/g, version)
9393
.replace(/__TOC__/g, tableOfContents.wrapToC(toc))
9494
.replace(/__GTOC__/g, nav)

src/generators/legacy-html/template.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
document.documentElement.classList.add('dark-mode');
2727
}
2828
</script>
29+
<meta property="og:title" content="__SECTION__ | Node.js __VERSION__ Documentation" />
30+
<meta property="og:image" content="https://nodejs.org/en/next-data/og/announcement/__SECTION__%20|%20Node.js%20__VERSION__%20Documentation" />
31+
<meta name="twitter:card" content="summary" />
32+
<meta name="twitter:creator" content="@nodejs" />
33+
<meta name="twitter:title" content="__SECTION__ | Node.js __VERSION__ Documentation" />
34+
<meta name="twitter:image" content="https://nodejs.org/static/images/logo-hexagon-card.png" />
35+
<meta name="twitter:image:alt" content="The Node.js Hexagon Logo">
2936
<style>
3037
html.dark-mode .shiki,
3138
html.dark-mode .shiki span {

0 commit comments

Comments
 (0)