` tag in it to change the title from “React App” to anything else.
+
+Note that normally you wouldn’t edit files in the `public` folder very often. For example, [adding a stylesheet](/docs/adding-a-stylesheet) is done without touching the HTML.
+
+If you need to dynamically update the page title based on the content, you can use the browser [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) API. For more complex scenarios when you want to change the title from React components, you can use [React Helmet](https://github.com/nfl/react-helmet), a third party library.
+
+If you use a custom server for your app in production and want to modify the title before it gets sent to the browser, you can follow advice in [this section](/docs/generating-dynamic-meta-tags-on-the-server). Alternatively, you can pre-build each page as a static HTML file which then loads the JavaScript bundle, which is covered [here](/docs/pre-rendering-into-static-html-files).
+
+## Generating Dynamic `` Tags on the Server
+
+Since Create React App doesn’t support server rendering, you might be wondering how to make `` tags dynamic and reflect the current URL. To solve this, we recommend to add placeholders into the HTML, like this:
+
+```html
+
+
+
+
+
+```
+
+Then, on the server, regardless of the backend you use, you can read `index.html` into memory and replace `__OG_TITLE__`, `__OG_DESCRIPTION__`, and any other placeholders with values depending on the current URL. Just make sure to sanitize and escape the interpolated values so that they are safe to embed into HTML!
+
+If you use a Node server, you can even share the route matching logic between the client and the server. However duplicating it also works fine in simple cases.
+
+## Injecting Data from the Server into the Page
+
+Similarly to the previous section, you can leave some placeholders in the HTML that inject global variables, for example:
+
+```js
+
+
+
+
+```
+
+Then, on the server, you can replace `__SERVER_DATA__` with a JSON of real data right before sending the response. The client code can then read `window.SERVER_DATA` to use it. **Make sure to [sanitize the JSON before sending it to the client](https://medium.com/node-security/the-most-common-xss-vulnerability-in-react-js-applications-2bdffbcc1fa0) as it makes your app vulnerable to XSS attacks.**
diff --git a/docusaurus/docs/updating-to-new-releases.md b/docusaurus/docs/updating-to-new-releases.md
index 825832464c8..b106673bc89 100644
--- a/docusaurus/docs/updating-to-new-releases.md
+++ b/docusaurus/docs/updating-to-new-releases.md
@@ -1,6 +1,6 @@
---
id: updating-to-new-releases
-title: Updating to New Releases
+title: Updating To New Releases
---
Create React App is divided into two packages:
diff --git a/docusaurus/docs/using-https-in-development.md b/docusaurus/docs/using-https-in-development.md
index 64b7bf217a8..465ca6e942a 100644
--- a/docusaurus/docs/using-https-in-development.md
+++ b/docusaurus/docs/using-https-in-development.md
@@ -1,6 +1,7 @@
---
id: using-https-in-development
-title: Using HTTPS in Development
+title: Using HTTPS In Development
+sidebar_label: HTTPS In Development
---
> Note: this feature is available with `react-scripts@0.4.0` and higher.
diff --git a/docusaurus/docs/using-the-public-folder.md b/docusaurus/docs/using-the-public-folder.md
index 2d8b0ba36fc..e6a973c45d6 100644
--- a/docusaurus/docs/using-the-public-folder.md
+++ b/docusaurus/docs/using-the-public-folder.md
@@ -1,6 +1,6 @@
---
id: using-the-public-folder
-title: Using the `public` Folder
+title: Using The public Folder
---
> Note: this feature is available with `react-scripts@0.5.0` and higher.
diff --git a/docusaurus/website/core/Footer.js b/docusaurus/website/core/Footer.js
index 246bf3a3521..ba617e64aed 100644
--- a/docusaurus/website/core/Footer.js
+++ b/docusaurus/website/core/Footer.js
@@ -40,9 +40,6 @@ class Footer extends React.Component {
Documentation
-
- API Reference (or other categories)
-
Community
diff --git a/docusaurus/website/i18n/en.json b/docusaurus/website/i18n/en.json
index 2e9f00cab6d..8a1ad0a38c5 100644
--- a/docusaurus/website/i18n/en.json
+++ b/docusaurus/website/i18n/en.json
@@ -6,28 +6,32 @@
"tagline": "Create React apps with no build configuration.",
"docs": {
"adding-a-css-modules-stylesheet": {
- "title": "Adding a CSS Modules Stylesheet"
+ "title": "Adding A CSS Modules Stylesheet",
+ "sidebar_label": "Adding CSS Modules"
},
"adding-a-router": {
- "title": "Adding a Router"
+ "title": "Adding A Router"
},
"adding-a-sass-stylesheet": {
- "title": "Adding a Sass Stylesheet"
+ "title": "Adding A Sass Stylesheet",
+ "sidebar_label": "Adding Sass Stylesheets"
},
"adding-a-stylesheet": {
- "title": "Adding a Stylesheet"
+ "title": "Adding A Stylesheet",
+ "sidebar_label": "Adding Stylesheets"
},
"adding-bootstrap": {
"title": "Adding Bootstrap"
},
"adding-custom-environment-variables": {
- "title": "Adding Custom Environment Variables"
+ "title": "Adding Custom Environment Variables",
+ "sidebar_label": "Environment Variables"
},
"adding-flow": {
"title": "Adding Flow"
},
"adding-images-fonts-and-files": {
- "title": "Adding Images, Fonts, and Files"
+ "title": "Adding Images, Fonts, And Files"
},
"adding-relay": {
"title": "Adding Relay"
@@ -36,133 +40,102 @@
"title": "Advanced Configuration"
},
"alternatives-to-ejecting": {
- "title": "Alternatives to Ejecting"
+ "title": "Alternatives To Ejecting"
},
"analyzing-the-bundle-size": {
"title": "Analyzing the Bundle Size",
- "sidebar_label": "Analyzing bundle size"
+ "sidebar_label": "Analyzing Bundle Size"
},
"available-scripts": {
"title": "Available Scripts",
- "sidebar_label": "Available scripts"
+ "sidebar_label": "Available Scripts"
},
"can-i-use-decorators": {
"title": "Can I Use Decorators?"
},
- "changing-the-page-title": {
- "title": "Changing the "
- },
"code-splitting": {
"title": "Code Splitting"
},
- "debugging-in-the-editor": {
- "title": "Debugging in the Editor"
- },
"debugging-tests": {
"title": "Debugging Tests",
- "sidebar_label": "Debugging tests"
+ "sidebar_label": "Debugging Tests"
},
"deployment": {
"title": "Deployment",
"sidebar_label": "Deployment"
},
"developing-components-in-isolation": {
- "title": "Developing Components in Isolation"
+ "title": "Developing Components In Isolation"
},
"documentation-intro": {
- "title": "Welcome to the Documentation",
- "sidebar_label": "About the docs"
+ "title": "Welcome To The Documentation",
+ "sidebar_label": "About The Docs"
},
"fetching-data-with-ajax-requests": {
- "title": "Fetching Data with AJAX Requests"
+ "title": "Fetching Data with AJAX Requests",
+ "sidebar_label": "Fetching Data"
},
"folder-structure": {
- "title": "Folder structure"
- },
- "formatting-code-automatically": {
- "title": "Formatting Code Automatically",
- "sidebar_label": "Formatting code"
- },
- "generating-dynamic-meta-tags-on-the-server": {
- "title": "Generating Dynamic `` Tags on the Server"
+ "title": "Folder Structure"
},
"getting-started": {
- "title": "Getting started",
- "sidebar_label": "Getting started"
+ "title": "Getting Started"
},
"importing-a-component": {
- "title": "Importing a Component"
- },
- "injecting-data-from-the-server-into-the-page": {
- "title": "Injecting Data from the Server into the Page"
+ "title": "Importing A Component"
},
"installing-a-dependency": {
- "title": "Installing a Dependency"
+ "title": "Installing A Dependency"
},
"integrating-with-an-api-backend": {
- "title": "Integrating with an API Backend"
- },
- "lint-output-in-the-editor": {
- "title": "Displaying Lint Output in the Editor",
- "sidebar_label": "In-editor linting"
+ "title": "Integrating With An API Backend",
+ "sidebar_label": "Integrating With An API"
},
"making-a-progressive-web-app": {
- "title": "Making a Progressive Web App"
+ "title": "Making A Progressive Web App"
},
"post-processing-css": {
"title": "Post-Processing CSS"
},
"pre-rendering-into-static-html-files": {
- "title": "Pre-Rendering into Static HTML Files"
+ "title": "Pre-Rendering Into Static HTML Files",
+ "sidebar_label": "Pre-Rendering Static HTML"
},
"proxying-api-requests-in-development": {
- "title": "Proxying API Requests in Development",
- "sidebar_label": "Proxying in development"
- },
- "publishing-components-to-npm": {
- "title": "Publishing components to npm",
- "sidebar_label": "Publishing to npm"
- },
- "README": {
- "title": "README"
+ "title": "Proxying API Requests In Development",
+ "sidebar_label": "Proxying In Development"
},
"running-tests": {
- "title": "Running Tests",
- "sidebar_label": "Running tests"
- },
- "sending-feedback": {
- "title": "Sending feedback",
- "sidebar_label": "Feedback"
- },
- "something-missing": {
- "title": "Something missing?",
- "sidebar_label": "Something missing?"
+ "title": "Running Tests"
},
- "supported-browsers": {
- "title": "Supported Browsers"
+ "setting-up-your-editor": {
+ "title": "Setting Up Your Editor",
+ "sidebar_label": "Editor Setup"
},
- "supported-language-features": {
- "title": "Supported Language Features"
+ "supported-browsers-features": {
+ "title": "Supported Browsers And Features",
+ "sidebar_label": "Browsers & Features"
},
- "syntax-highlighting-in-the-editor": {
- "title": "Syntax highlighting in the editor",
- "sidebar_label": "Syntax highlighting"
+ "title-and-meta-tags": {
+ "title": "Title And Meta Tags",
+ "sidebar_label": "Title & Meta Tags"
},
"troubleshooting": {
"title": "Troubleshooting",
"sidebar_label": "Troubleshooting"
},
"updating-to-new-releases": {
- "title": "Updating to New Releases"
+ "title": "Updating To New Releases"
},
"using-global-variables": {
"title": "Using Global Variables"
},
"using-https-in-development": {
- "title": "Using HTTPS in Development"
+ "title": "Using HTTPS In Development",
+ "sidebar_label": "HTTPS In Development"
},
"using-the-public-folder": {
- "title": "Using the `public` Folder"
+ "title": "Using The public Folder"
}
},
"links": {
@@ -174,9 +147,12 @@
"Welcome": "Welcome",
"Getting Started": "Getting Started",
"Development": "Development",
- "How-to": "How-to",
+ "Styles and Assets": "Styles and Assets",
+ "Building your App": "Building your App",
"Testing": "Testing",
+ "Back-End Integration": "Back-End Integration",
"Deployment": "Deployment",
+ "Advanced Usage": "Advanced Usage",
"Support": "Support"
}
},
diff --git a/docusaurus/website/sidebars.json b/docusaurus/website/sidebars.json
index cbeb4788cd1..e774b26e8d4 100644
--- a/docusaurus/website/sidebars.json
+++ b/docusaurus/website/sidebars.json
@@ -4,56 +4,54 @@
"documentation-intro"
],
"Getting Started": [
- "getting-started",
- "folder-structure",
+ "getting-started",
+ "folder-structure",
"available-scripts",
- "supported-browsers",
- "supported-language-features"
+ "supported-browsers-features",
+ "updating-to-new-releases"
],
"Development": [
- "syntax-highlighting-in-the-editor",
- "lint-output-in-the-editor",
- "debugging-in-the-editor",
- "formatting-code-automatically",
- "proxying-api-requests-in-development",
+ "setting-up-your-editor",
"developing-components-in-isolation",
- "analyzing-the-bundle-size"
+ "analyzing-the-bundle-size",
+ "using-https-in-development"
],
- "How-to": [
- "changing-the-page-title",
- "installing-a-dependency",
- "importing-a-component",
- "code-splitting",
+ "Styles and Assets": [
"adding-a-stylesheet",
"adding-a-css-modules-stylesheet",
"adding-a-sass-stylesheet",
"post-processing-css",
"adding-images-fonts-and-files",
"using-the-public-folder",
+ "code-splitting"
+ ],
+ "Building your App": [
+ "installing-a-dependency",
+ "importing-a-component",
"using-global-variables",
"adding-bootstrap",
"adding-flow",
"adding-relay",
"adding-a-router",
"adding-custom-environment-variables",
- "can-i-use-decorators",
+ "making-a-progressive-web-app"
+ ],
+ "Testing": ["running-tests", "debugging-tests"],
+ "Back-End Integration": [
+ "proxying-api-requests-in-development",
"fetching-data-with-ajax-requests",
"integrating-with-an-api-backend",
- "using-https-in-development",
- "generating-dynamic-meta-tags-on-the-server",
+ "title-and-meta-tags"
+ ],
+ "Deployment": ["deployment"],
+ "Advanced Usage": [
+ "can-i-use-decorators",
"pre-rendering-into-static-html-files",
- "injecting-data-from-the-server-into-the-page",
- "making-a-progressive-web-app",
"advanced-configuration",
"alternatives-to-ejecting"
],
- "Testing": ["running-tests", "debugging-tests"],
- "Deployment": ["publishing-components-to-npm", "deployment"],
"Support": [
- "troubleshooting",
- "updating-to-new-releases",
- "sending-feedback",
- "something-missing"
+ "troubleshooting"
]
}
}
diff --git a/docusaurus/website/siteConfig.js b/docusaurus/website/siteConfig.js
index cbaf69d0395..5c59bc8ab47 100644
--- a/docusaurus/website/siteConfig.js
+++ b/docusaurus/website/siteConfig.js
@@ -60,7 +60,7 @@ const siteConfig = {
*/
// This copyright info is used in /core/Footer.js and blog RSS/Atom feeds.
- copyright: `Copyright © ${new Date().getFullYear()} Facebook`,
+ copyright: `Copyright © ${new Date().getFullYear()} Facebook Inc.`,
highlight: {
// Highlight.js theme to use for syntax highlighting in code blocks.
diff --git a/docusaurus/website/static/css/custom.css b/docusaurus/website/static/css/custom.css
index 85626861f9b..faec652e6bf 100644
--- a/docusaurus/website/static/css/custom.css
+++ b/docusaurus/website/static/css/custom.css
@@ -15,6 +15,10 @@
color: inherit;
}
+.post a {
+ text-decoration: underline;
+}
+
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
}