Skip to content

Commit

Permalink
Merge pull request #801 from iterative/fix-meta
Browse files Browse the repository at this point in the history
Generalize, review and fix meta fields
  • Loading branch information
shcheklein authored Nov 19, 2019
2 parents a3fa40f + 690ec58 commit def161a
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 32 deletions.
1 change: 0 additions & 1 deletion consts/index.js

This file was deleted.

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 '../src/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
2 changes: 1 addition & 1 deletion pages/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import RightPanel from '../src/Documentation/RightPanel/RightPanel'
import fetch from 'isomorphic-fetch'
import kebabCase from 'lodash.kebabcase'
// constants
import { HEADER } from '../consts'
import { HEADER } from '../src/consts'
// sidebar data and helpers
import sidebar, { getItemByPath } from '../src/Documentation/SidebarMenu/helper'
// styles
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 '../src/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 '../src/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 '../src/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
2 changes: 1 addition & 1 deletion src/Tooltip/desktop-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion src/TopMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions src/consts.js
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit def161a

Please sign in to comment.