From b0136b930c0a1ede9090dc6cbbb37de71423a1b3 Mon Sep 17 00:00:00 2001 From: Ivan Shcheklein Date: Mon, 18 Nov 2019 17:28:17 -0800 Subject: [PATCH] generalize, review and fix meta fields --- consts/index.js | 9 ++++++++ pages/_document.js | 37 ++++++++++++------------------- pages/features.js | 3 ++- pages/index.js | 3 ++- pages/support.js | 3 ++- src/Documentation/HeadInjector.js | 8 +++++-- 6 files changed, 35 insertions(+), 28 deletions(-) diff --git a/consts/index.js b/consts/index.js index d58950b582..2005763cc1 100644 --- a/consts/index.js +++ b/consts/index.js @@ -1 +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' diff --git a/pages/_document.js b/pages/_document.js index f94e8ee934..f73dab1cdd 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 '../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..b2a39ec0ec 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 '../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..33dd19a922 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} + )