From dc4e8bb462212e821d74058614512beb438d6723 Mon Sep 17 00:00:00 2001 From: Dan Abramov <dan.abramov@gmail.com> Date: Sat, 11 Feb 2017 13:45:30 +0000 Subject: [PATCH] Make index.html interpolation instructions less clashing with env syntax --- packages/react-scripts/template/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 8315f3074..312585598 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -705,11 +705,11 @@ Since Create React App doesn’t support server rendering, you might be wonderin <!doctype html> <html lang="en"> <head> - <meta property="og:title" content="%OG_TITLE%"> - <meta property="og:description" content="%OG_DESCRIPTION%"> + <meta property="og:title" content="__OG_TITLE__"> + <meta property="og:description" content="__OG_DESCRIPTION__"> ``` -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! +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. -- GitLab