提交 61bee72d 编写于 作者: J Jason Park

Add Open Graph meta tags

上级 29d7c719
......@@ -248,10 +248,11 @@ class App extends React.Component {
render() {
const { navigatorOpened, workspaceWeights, editorTabIndex } = this.state;
const files = getFiles(this.props.current);
const titleArray = getTitleArray(this.props.current);
const gistSaved = this.isGistSaved();
const title = `${gistSaved ? '' : '(Unsaved) '}${titleArray.join(' - ')}`;
const description = this.getDescription();
const file = files[editorTabIndex];
......@@ -269,8 +270,10 @@ class App extends React.Component {
return (
<div className={styles.app}>
<Helmet>
<title>{gistSaved ? '' : '(Unsaved) '}{titleArray.join(' - ')}</title>
<title>{title}</title>
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
</Helmet>
<Header className={styles.header} onClickTitleBar={() => this.toggleNavigatorOpened()}
navigatorOpened={navigatorOpened} loadScratchPapers={() => this.loadScratchPapers()}
......
......@@ -16,6 +16,8 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#393939">
<meta property="og:image" content="https://raw.githubusercontent.com/algorithm-visualizer/algorithm-visualizer/master/branding/screenshot.png" />
<meta property="og:site_name" content="Algorithm Visualizer" />
<link rel="shortcut icon" href="/favicon.png" type="image/png">
<link rel="manifest" href="/manifest.json">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
......@@ -23,4 +25,4 @@
<body>
<div id="root" style="height: 100%"></div>
</body>
</html>
\ No newline at end of file
</html>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册