1
1
mirror of https://github.com/primer/css.git synced 2024-09-22 14:17:25 +03:00

simplify metadata

This commit is contained in:
Shawn Allen 2018-12-04 15:59:30 -08:00
parent 15e336ddb7
commit 5054a557e2

View File

@ -8,7 +8,7 @@ import Octicon, {Pencil} from '@githubprimer/octicons-react'
import {basename, join} from 'path'
import * as primerComponents from '@primer/components'
import * as docComponents from '../src/components'
import {pathMap, requirePage} from '../src/utils'
import {rootPage} from '../src/utils'
import 'primer/index.scss'
@ -39,13 +39,10 @@ export default class MyApp extends App {
render() {
// strip the trailing slash
const pathname = this.props.router.pathname.replace(/\/$/, '')
const filename = pathMap[pathname]
const {Component, page} = this.props
const meta = {}
if (filename) {
Object.assign(meta, requirePage(filename).meta)
}
const node = rootPage.first(node => node.path === pathname)
const meta = node ? node.meta : {}
return (
<BaseStyles style={{fontFamily: theme.fonts.normal}}>