Skip to content

Commit 61bee72

Browse files
committed
Add Open Graph meta tags
1 parent 29d7c71 commit 61bee72

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/frontend/components/App/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,11 @@ class App extends React.Component {
248248

249249
render() {
250250
const { navigatorOpened, workspaceWeights, editorTabIndex } = this.state;
251+
251252
const files = getFiles(this.props.current);
252253
const titleArray = getTitleArray(this.props.current);
253-
254254
const gistSaved = this.isGistSaved();
255+
const title = `${gistSaved ? '' : '(Unsaved) '}${titleArray.join(' - ')}`;
255256
const description = this.getDescription();
256257
const file = files[editorTabIndex];
257258

@@ -269,8 +270,10 @@ class App extends React.Component {
269270
return (
270271
<div className={styles.app}>
271272
<Helmet>
272-
<title>{gistSaved ? '' : '(Unsaved) '}{titleArray.join(' - ')}</title>
273+
<title>{title}</title>
273274
<meta name="description" content={description} />
275+
<meta property="og:title" content={title} />
276+
<meta property="og:description" content={description} />
274277
</Helmet>
275278
<Header className={styles.header} onClickTitleBar={() => this.toggleNavigatorOpened()}
276279
navigatorOpened={navigatorOpened} loadScratchPapers={() => this.loadScratchPapers()}

src/frontend/template.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
<meta http-equiv="x-ua-compatible" content="ie=edge">
1717
<meta name="viewport" content="width=device-width">
1818
<meta name="theme-color" content="#393939">
19+
<meta property="og:image" content="https://raw.githubusercontent.com/algorithm-visualizer/algorithm-visualizer/master/branding/screenshot.png" />
20+
<meta property="og:site_name" content="Algorithm Visualizer" />
1921
<link rel="shortcut icon" href="/favicon.png" type="image/png">
2022
<link rel="manifest" href="/manifest.json">
2123
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
2224
</head>
2325
<body>
2426
<div id="root" style="height: 100%"></div>
2527
</body>
26-
</html>
28+
</html>

0 commit comments

Comments
 (0)