Skip to content

Commit dc4e8bb

Browse files
authored
Make index.html interpolation instructions less clashing with env syntax
1 parent 67e6cf5 commit dc4e8bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-scripts/template/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,11 @@ Since Create React App doesn’t support server rendering, you might be wonderin
705705
<!doctype html>
706706
<html lang="en">
707707
<head>
708-
<meta property="og:title" content="%OG_TITLE%">
709-
<meta property="og:description" content="%OG_DESCRIPTION%">
708+
<meta property="og:title" content="__OG_TITLE__">
709+
<meta property="og:description" content="__OG_DESCRIPTION__">
710710
```
711711

712-
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!
712+
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!
713713

714714
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.
715715

0 commit comments

Comments
 (0)