Skip to content

Commit

Permalink
generalize, review and fix meta fields
Browse files Browse the repository at this point in the history
  • Loading branch information
shcheklein committed Nov 19, 2019
1 parent a3fa40f commit b0136b9
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 28 deletions.
9 changes: 9 additions & 0 deletions consts/index.js
Original file line number Diff line number Diff line change
@@ -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'
37 changes: 14 additions & 23 deletions pages/_document.js
Original file line number Diff line number Diff line change
@@ -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 => (
<div className="inject" dangerouslySetInnerHTML={{ __html: str }} />
Expand All @@ -27,41 +28,31 @@ export default class Page extends Document {
<html lang="en">
<Head>
<meta charSet="utf-8" />
<meta name="description" content={DESCRIPTION} />
<meta name="keywords" content={KEYWORDS} />
<meta name="description" content={META_DESCRIPTION} />
<meta name="keywords" content={META_KEYWORDS} />
<meta
prefix="og: http://ogp.me/ns#"
property="og:image"
content="http://dvc.org/static/social-share.png"
content={META_SOCIAL_IMAGE}
/>
<meta
prefix="og: http://ogp.me/ns#"
property="og:image:secure_url"
content="https://dvc.org/static/social-share.png"
content={META_SOCIAL_IMAGE}
/>
<meta
prefix="og: http://ogp.me/ns#"
property="og:description"
content="DVC is designed to handle large data files, models, and
metrics as well as code. DVC is an open-source framework and
distributed version control system for machine learning projects."
content={META_DESCRIPTION}
/>
<meta
prefix="og: http://ogp.me/ns#"
property="og:title"
content="Data Science Version Control System"
content={META_BASE_TITLE}
/>
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:image"
content="https://dvc.org/static/social-share.png"
/>
<meta
name="twitter:description"
content="DVC is designed to handle large data files, models, and
metrics as well as code. DVC is an open-source framework and
distributed version control system for machine learning projects."
/>
<meta name="twitter:image" content={META_SOCIAL_IMAGE} />
<meta name="twitter:description" content={META_DESCRIPTION} />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
Expand Down
3 changes: 2 additions & 1 deletion pages/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import Page from '../src/Page'
import Hero from '../src/Hero'
import FeaturesHero from '../src/FeaturesHero'
import TrySection from '../src/TrySection'
import { META_BASE_TITLE } from '../consts'

const HeadInjector = () => (
<Head>
<title>Features | Machine Learning Version Control System</title>
<title>Features | {META_BASE_TITLE}</title>
</Head>
)

Expand Down
3 changes: 2 additions & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Diagram from '../src/Diagram'
import PromoSection from '../src/PromoSection'
import UseCases from '../src/UseCases'
import Subscribe from '../src/Subscribe'
import { META_BASE_TITLE } from '../consts'

const HeadInjector = () => (
<Head>
Expand All @@ -25,7 +26,7 @@ const HeadInjector = () => (
type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"
/>
<title>Machine Learning Version Control System · DVC</title>
<title>{META_BASE_TITLE}</title>
</Head>
)

Expand Down
3 changes: 2 additions & 1 deletion pages/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => (
<Head>
<title>Support | Machine Learning Version Control System</title>
<title>Support | {{ META_BASE_TITLE }}</title>
</Head>
)

Expand Down
8 changes: 6 additions & 2 deletions src/Documentation/HeadInjector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }) => (
<Head>
<link
rel="stylesheet"
Expand All @@ -21,7 +23,9 @@ export const HeadInjector = () => (
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn/docsearch.min.js"
/>
<title>Documentation | Machine Learning Version Control System · DVC</title>
<title>
{sectionName} | {META_BASE_TITLE}
</title>
</Head>
)

Expand Down

0 comments on commit b0136b9

Please sign in to comment.