Skip to content

Commit cc1ab23

Browse files
authored
add robots.txt, add JSON-LD structured data, redirect for RSS feed (#4812)
1 parent 9623841 commit cc1ab23

17 files changed

+86
-14
lines changed

website/docusaurus.config.ts

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ const config: Config = {
7878
},
7979

8080
title: 'React Native',
81-
tagline: 'A framework for building native apps using React',
82-
organizationName: 'facebook',
81+
tagline:
82+
'A framework for building native apps for Android, iOS, and more using React',
83+
organizationName: 'Meta Platforms, Inc.',
8384
projectName: 'react-native',
8485
url: 'https://reactnative.dev',
8586
baseUrl: '/',
@@ -100,7 +101,7 @@ const config: Config = {
100101
{src: 'https://snack.expo.dev/embed.js', defer: true},
101102
{src: 'https://platform.twitter.com/widgets.js', async: true},
102103
],
103-
favicon: 'img/favicon.ico',
104+
favicon: 'favicon.ico',
104105
titleDelimiter: '·',
105106
customFields: {
106107
users,
@@ -111,6 +112,62 @@ const config: Config = {
111112
locales: ['en'],
112113
},
113114
onBrokenLinks: 'warn',
115+
headTags: [
116+
{
117+
tagName: 'script',
118+
attributes: {
119+
type: 'application/ld+json',
120+
},
121+
innerHTML: JSON.stringify({
122+
'@context': 'https://schema.org/',
123+
'@type': 'WebPage',
124+
'@id': 'https://reactnative.dev/',
125+
url: 'https://reactnative.dev/',
126+
name: 'React Native · Learn once, write anywhere',
127+
description:
128+
'A framework for building native apps for Android, iOS, and more using React',
129+
logo: 'https://reactnative.dev/img/pwa/manifest-icon-192.png',
130+
inLanguage: 'en-US',
131+
}),
132+
},
133+
{
134+
tagName: 'script',
135+
attributes: {
136+
type: 'application/ld+json',
137+
},
138+
innerHTML: JSON.stringify({
139+
'@type': 'WebSite',
140+
'@id': 'https://reactnative.dev/',
141+
url: 'https://reactnative.dev/',
142+
name: 'React Native · Learn once, write anywhere',
143+
description:
144+
'A framework for building native apps for Android, iOS, and more using React',
145+
publisher: 'Meta Platforms, Inc.',
146+
potentialAction: [
147+
{
148+
'@type': 'SearchAction',
149+
target: {
150+
'@type': 'EntryPoint',
151+
urlTemplate: 'https://reactnative.dev/search?q={query}',
152+
},
153+
'query-input': {
154+
'@type': 'PropertyValueSpecification',
155+
valueRequired: true,
156+
valueName: 'query',
157+
},
158+
},
159+
],
160+
inLanguage: 'en-US',
161+
}),
162+
},
163+
{
164+
tagName: 'link',
165+
attributes: {
166+
rel: 'apple-touch-icon',
167+
href: '/img/pwa/apple-icon-180.png',
168+
},
169+
},
170+
],
114171
presets: [
115172
[
116173
'@docusaurus/preset-classic',
@@ -149,10 +206,6 @@ const config: Config = {
149206
require.resolve('./src/css/versions.scss'),
150207
],
151208
},
152-
// TODO: GA is deprecated, remove once we're sure data is streaming in GA4 via gtag.
153-
googleAnalytics: {
154-
trackingID: 'UA-41298772-2',
155-
},
156209
gtag: {
157210
trackingID: 'G-58L13S6BDP',
158211
},
@@ -504,6 +557,7 @@ const config: Config = {
504557
content: 'https://reactnative.dev/img/logo-share.png',
505558
},
506559
{name: 'twitter:site', content: '@reactnative'},
560+
{name: 'apple-mobile-web-app-capable', content: 'yes'},
507561
],
508562
} satisfies Preset.ThemeConfig,
509563
};

website/src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Home from '../components/Home';
1515
const Index = () => {
1616
return (
1717
<Layout
18-
description="A framework for building native apps using React"
18+
description="A framework for building native apps for Android, iOS, and more using React"
1919
wrapperClassName="homepage">
2020
<Head>
2121
<title>React Native · Learn once, write anywhere</title>

website/static/_redirects

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Redirects from what the browser requests to what we serve
22

3+
# RSS feed
4+
/blog/feed /blog/rss.xml
5+
/blog/feed.xml /blog/rss.xml
6+
37
# Renamed pages
48
/docs/android-setup /docs/getting-started
59
/docs/building-for-apple-tv /docs/building-for-tv
-1012 Bytes
Binary file not shown.
File renamed without changes.

website/static/img/header_logo.png

-1.72 KB
Binary file not shown.

website/static/img/opengraph.png

-43.6 KB
Binary file not shown.
-6.82 KB
Binary file not shown.
-8.8 KB
Binary file not shown.
-9.74 KB
Binary file not shown.

0 commit comments

Comments
 (0)