Skip to content

Commit

Permalink
flag to enable/disable
Browse files Browse the repository at this point in the history
  • Loading branch information
jschuler committed Sep 27, 2018
1 parent 192e589 commit 1fe996e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/patternfly-4/react-docs/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LIVE_EXAMPLES=true
1 change: 1 addition & 0 deletions packages/patternfly-4/react-docs/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LIVE_EXAMPLES=true
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@ const defaultProps = {
images: []
};

const LIVE_EXAMPLES = /true/i.test(process.env.LIVE_EXAMPLES);

const Example = ({ children, title, className, description, raw, images, ...props }) => (
<div>
<Title size="lg">{title}</Title>
{Boolean(description) && <p className={css(styles.description)}>{description}</p>}
<LiveDemo raw={raw.trim()} images={images} className={className} />
{LIVE_EXAMPLES ? (
<LiveDemo raw={raw.trim()} images={images} className={className} />
) : (
<div className={css(className, styles.example)} {...props}>
{children}
</div>
)}
</div>
);

Expand Down
8 changes: 2 additions & 6 deletions packages/patternfly-4/react-docs/src/layouts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ const Layout = ({ children, data }) => {

return (
<React.Fragment>
{/* <Helmet
meta={[
{ name: 'description', content: 'PatternFly React Documentation' },
{ name: 'keywords', content: 'React, PatternFly, Red Hat' }
]}
/> */}
<Helmet>
<meta charSet="utf-8" />
<meta name="description" content="PatternFly React Documentation" />
<meta name="keywords" content="React, PatternFly, Red Hat" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/theme/monokai.min.css" />
</Helmet>
Expand Down

0 comments on commit 1fe996e

Please sign in to comment.