diff --git a/consts/index.js b/consts/index.js deleted file mode 100644 index d58950b582..0000000000 --- a/consts/index.js +++ /dev/null @@ -1 +0,0 @@ -export const HEADER = 'header' diff --git a/pages/_document.js b/pages/_document.js index f94e8ee934..e4c4865665 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -1,11 +1,12 @@ import React from 'react' import Document, { Head, Main, NextScript } from 'next/document' import { ServerStyleSheet } from 'styled-components' - -const DESCRIPTION = - `Open-source version control system for Data Science and Machine Learning ` + - `projects. Track your data, models, and experiments with a Git-like tool.` -const KEYWORDS = `data version control machine learning models management` +import { + META_BASE_TITLE, + META_DESCRIPTION, + META_KEYWORDS, + META_SOCIAL_IMAGE +} from '../src/consts' const inject = str => (
@@ -27,41 +28,31 @@ export default class Page extends Document { - - + + - - + + - Machine Learning Version Control System · DVC + {META_BASE_TITLE} ) diff --git a/pages/support.js b/pages/support.js index 1eab32e374..09ca9b142c 100644 --- a/pages/support.js +++ b/pages/support.js @@ -11,10 +11,11 @@ import Page from '../src/Page' import Hero from '../src/Hero' import TrySection from '../src/TrySection' import Popover from '../src/Popover/Popover' +import { META_BASE_TITLE } from '../src/consts' const HeadInjector = () => ( - Support | Machine Learning Version Control System + Support | {META_BASE_TITLE} ) diff --git a/src/Documentation/HeadInjector.js b/src/Documentation/HeadInjector.js index 045d0964c5..4a9b06c1d1 100644 --- a/src/Documentation/HeadInjector.js +++ b/src/Documentation/HeadInjector.js @@ -2,7 +2,9 @@ import Head from 'next/head' import PropTypes from 'prop-types' import React from 'react' -export const HeadInjector = () => ( +import { META_BASE_TITLE } from '../consts' + +export const HeadInjector = ({ sectionName = 'Documentation' }) => ( ( type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2.6.2/dist/cdn/docsearch.min.js" /> - Documentation | Machine Learning Version Control System · DVC + + {sectionName} | {META_BASE_TITLE} + ) diff --git a/src/Tooltip/desktop-view.js b/src/Tooltip/desktop-view.js index e2bd40e3f9..267287edc8 100644 --- a/src/Tooltip/desktop-view.js +++ b/src/Tooltip/desktop-view.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import ReactMarkdown from 'react-markdown' import styled from 'styled-components' -import { HEADER } from '../../consts' +import { HEADER } from '../consts' class DesktopView extends Component { state = { diff --git a/src/TopMenu/index.js b/src/TopMenu/index.js index d0661351b1..c3204dbfa0 100644 --- a/src/TopMenu/index.js +++ b/src/TopMenu/index.js @@ -8,7 +8,7 @@ import throttle from 'lodash.throttle' import styled from 'styled-components' import { media } from '../styles' // constants -import { HEADER } from '../../consts' +import { HEADER } from '../consts' const MIN_HEIGHT = 78 diff --git a/src/consts.js b/src/consts.js new file mode 100644 index 0000000000..2005763cc1 --- /dev/null +++ b/src/consts.js @@ -0,0 +1,10 @@ +export const HEADER = 'header' + +export const META_BASE_TITLE = 'Data Version Control · DVC' +export const META_DESCRIPTION = + 'Open-source version control system for Data Science and Machine Learning ' + + 'projects. Git-like experience to organize your data, models, and ' + + 'experiments.' +export const META_KEYWORDS = + 'data version control machine learning models management' +export const META_SOCIAL_IMAGE = 'https://dvc.org/static/social-share.png'