File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import styled from 'styled-components';
5
5
6
6
import { ComponentsMenu } from './components-menu' ;
7
7
import { paths } from '../paths' ;
8
+ import { mapComponentName } from '../lib/constants' ;
8
9
9
10
export const Layout = ( { children } ) => {
10
11
const data = useStaticQuery ( graphql `
@@ -52,12 +53,14 @@ function createMapping(data) {
52
53
}
53
54
const prefix = data . pathPrefix || '' ;
54
55
55
- packages [ component . meta . package ] . push ( {
56
- ...component . meta ,
57
- path : prefix + paths . componentUsage ( component . meta ) ,
58
- id : component . id ,
59
- title : camelCase ( component . meta . name ) ,
60
- } ) ;
56
+ if ( component . meta . category !== mapComponentName ) {
57
+ packages [ component . meta . package ] . push ( {
58
+ ...component . meta ,
59
+ path : prefix + paths . componentUsage ( component . meta ) ,
60
+ id : component . id ,
61
+ title : camelCase ( component . meta . name ) ,
62
+ } ) ;
63
+ }
61
64
}
62
65
63
66
return Object . keys ( packages ) . reduce ( ( list , name ) => {
Original file line number Diff line number Diff line change
1
+ export const mapComponentName = 'map' ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { graphql } from 'gatsby';
3
3
import { MDXRenderer } from 'gatsby-plugin-mdx' ;
4
4
import { pascalCase } from 'change-case' ;
5
5
import { Layout } from '../components/layout' ;
6
+ import { mapComponentName } from '../lib/constants' ;
6
7
7
8
const installation = ( { package : p } ) =>
8
9
`npm install ${ p }
@@ -11,6 +12,9 @@ yarn add ${p}`;
11
12
12
13
const ComponentPage = ( { data, pageContext } ) => {
13
14
const { frontmatter, body } = data . usage ;
15
+ if ( frontmatter . category === mapComponentName ) {
16
+ return < MDXRenderer > { body } </ MDXRenderer > ;
17
+ }
14
18
return (
15
19
< Layout >
16
20
< div >
Original file line number Diff line number Diff line change 13
13
"build" : " yarn workspace example build" ,
14
14
"deploy" : " yarn workspace gatsby-theme-woly publish" ,
15
15
"theme" : " yarn workspace gatsby-theme-woly" ,
16
- "example" : " yarn workspace example" ,
16
+ "example" : " yarn workspace example start " ,
17
17
"clean" : " yarn example gatsby clean && yarn theme gatsby clean"
18
18
},
19
19
"workspaces" : [
You can’t perform that action at this time.
0 commit comments