Skip to content

Commit d1bb614

Browse files
authored
Add OpenGraph and Twitter metadata (#327)
* Add OpenGraph and Twitter metadata * Apply suggestions * Update description * Update description * Update URL * Fallback
1 parent 729d7a8 commit d1bb614

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

preview-src/index.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
= Hardware and Software Requirements
2-
Author Name
2+
:description: This page provides a preview of the Redpanda documentation UI, including API references, Bloblang playground, and site search.
33
:idprefix:
44
:idseparator: -
55
:!example-caption:
66
:!table-caption:
77
:page-pagination:
88

9+
{description}
10+
911
```bash
1012
alias internal-rpk="kubectl --namespace <namespace> exec -i -t redpanda-0 -c redpanda -- rpk"
1113
```

preview-src/ui-model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
antoraVersion: '1.0.0'
22
site:
3-
url: http://localhost:5252
3+
url: https://deploy-preview-327--docs-ui.netlify.app
44
title: UI Preview
55
homeUrl: &home_url /xyz/24.3/index.html
66
components:

src/img/redpanda_social-card.png

274 KB
Loading

src/partials/head-info.hbs

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,37 @@
1111
{{/unless}}
1212
{{#with page.title}}
1313
<meta property="og:title" content="{{{this}}} | Redpanda {{{@root.page.component.title}}}">
14+
<meta name="twitter:title" content="{{{this}}} | Redpanda {{{@root.page.component.title}}}">
1415
{{/with}}
15-
{{#with page.description}}
16-
<meta name="description" content="{{{detag this}}}">
17-
<meta property="og:description" content="{{{detag this}}}">
16+
{{#with page.canonicalUrl}}
17+
<meta property="og:url" content="{{{this}}}">
1818
{{/with}}
19+
{{#if page.description}}
20+
<meta name="description" content="{{{detag page.description}}}">
21+
<meta property="og:description" content="{{{detag page.description}}}">
22+
<meta name="twitter:description" content="{{{detag page.description}}}">
23+
{{else}}
24+
<meta name="description" content="Redpanda Documentation: Guides, API references, and resources for event streaming.">
25+
<meta property="og:description" content="Redpanda Documentation: Guides, API references, and resources for event streaming.">
26+
<meta name="twitter:description" content="Redpanda Documentation: Guides, API references, and resources for event streaming.">
27+
{{/if}}
1928
{{#with page.keywords}}
2029
<meta name="keywords" content="{{{this}}}">
2130
{{/with}}
2231
{{#with (or antoraVersion site.antoraVersion)}}
2332
<meta name="generator" content="Antora {{{this}}}">
2433
{{/with}}
34+
{{#if (and (ne page.component.title 'home') (ne page.layout 'labs-search') (ne page.attributes.role 'home'))}}
35+
<meta property="og:type" content="article">
36+
{{else}}
37+
<meta property="og:type" content="website">
38+
{{/if}}
39+
<meta property="og:site_name" content="Redpanda Documentation">
40+
<meta property="og:image" content="{{#with @root.site.url}}{{{this}}}{{/with}}/_/img/redpanda_social-card.png">
41+
<meta property="og:image:type" content="image/png">
42+
<meta property="og:image:alt" content="Redpanda Documentation Social Card">
43+
<meta property="og:image:width" content="1200">
44+
<meta property="og:image:height" content="630">
45+
<meta name="twitter:card" content="summary_large_image">
46+
<meta name="twitter:image" content="{{#with @root.site.url}}{{{this}}}{{/with}}/_/img/redpanda_social-card.png">
47+
<meta name="twitter:image:alt" content="Redpanda Documentation Social Card">

0 commit comments

Comments
 (0)