-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1212 from matuzalemsteles/Nightly
Proposal for the Nightly Environment
- Loading branch information
Showing
30 changed files
with
268 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GATSBY_CLAY_NIGHTLY=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GATSBY_CLAY_NIGHTLY=false |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const visit = require('unist-util-visit'); | ||
|
||
module.exports = ({markdownAST}) => { | ||
visit(markdownAST, 'heading', node => { | ||
if ( | ||
node.depth === 1 || | ||
node.depth === 2 || | ||
node.depth === 3 || | ||
node.depth === 4 | ||
) { | ||
node.data = { | ||
hProperties: { | ||
class: 'clay-h' + node.depth | ||
} | ||
} | ||
} | ||
}); | ||
|
||
visit(markdownAST, 'paragraph', node => { | ||
node.data = { | ||
hProperties: { | ||
class: 'clay-p' | ||
} | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "gatsby-remark-typography", | ||
"version": "0.0.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,80 @@ | ||
import React, { Component } from 'react'; | ||
import React, {Component} from 'react'; | ||
import classNames from 'classnames'; | ||
import { Link } from "gatsby" | ||
import {Link} from 'gatsby'; | ||
|
||
class Navigation extends Component { | ||
_handleOnClick(index, depth, section, event) { | ||
event.stopPropagation(); | ||
_handleOnClick(index, depth, section, event) { | ||
event.stopPropagation(); | ||
|
||
const elementRef = this.refs[`navItem${index}${depth}`]; | ||
const elementRef = this.refs[`navItem${index}${depth}`]; | ||
|
||
if (!elementRef.classList.contains('active') || !!section.items) { | ||
elementRef.classList.toggle('active'); | ||
} | ||
} | ||
if (!elementRef.classList.contains('active') || !!section.items) { | ||
elementRef.classList.toggle('active'); | ||
} | ||
} | ||
|
||
_isActive(section) { | ||
const { location } = this.props; | ||
const match = location.pathname.split('/'); | ||
const id = match[match.length - 1].split('.'); | ||
_isActive(section) { | ||
const {location} = this.props; | ||
const match = location.pathname.split('/'); | ||
const id = match[match.length - 1].split('.'); | ||
|
||
if (section.items) { | ||
return match.includes(section.id); | ||
} | ||
if (section.items) { | ||
return match.includes(section.id); | ||
} | ||
|
||
return id[0] === section.id; | ||
} | ||
return id[0] === section.id; | ||
} | ||
|
||
renderNavigationItems() { | ||
const { sectionList, location, depth = 0 } = this.props; | ||
renderNavigationItems() { | ||
const {sectionList, location, depth = 0} = this.props; | ||
|
||
return sectionList.map((section, index) => { | ||
let style = classNames({ | ||
'active': this._isActive(section) === true, | ||
'nav-heading': section.items | ||
return sectionList.map((section, index) => { | ||
let style = classNames({ | ||
'active': this._isActive(section) === true, | ||
'nav-heading': section.items, | ||
}); | ||
|
||
return( | ||
<li key={index} ref={`navItem${index}${depth}`} className={style} onClick={this._handleOnClick.bind(this, index, depth, section)}> | ||
<Anchor page={section} /> | ||
|
||
{section.items && ( | ||
<Navigation sectionList={section.items} location={location} depth={depth + 1} /> | ||
)} | ||
</li> | ||
); | ||
}); | ||
} | ||
return ( | ||
<li key={index} ref={`navItem${index}${depth}`} className={style} onClick={this._handleOnClick.bind(this, index, depth, section)}> | ||
<Anchor page={section} /> | ||
|
||
render() { | ||
return( | ||
<ul className="nav nav-nested nav-pills nav-stacked"> | ||
{this.renderNavigationItems()} | ||
</ul> | ||
); | ||
} | ||
{section.items && ( | ||
<Navigation sectionList={section.items} location={location} depth={depth + 1} /> | ||
)} | ||
</li> | ||
); | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<ul className="nav nav-nested nav-pills nav-stacked"> | ||
{this.renderNavigationItems()} | ||
</ul> | ||
); | ||
} | ||
} | ||
|
||
const Anchor = ({page}) => { | ||
if (page.items) { | ||
return( | ||
<a className="align-middle" href="javascript:;"> | ||
<span>{page.title}</span> | ||
<svg className="collapse-toggle clay-icon icon-monospaced"> | ||
<use xlinkHref="/images/icons/icons.svg#caret-bottom" /> | ||
</svg> | ||
</a> | ||
); | ||
} | ||
if (page.items) { | ||
return ( | ||
<a className="align-middle" href="javascript:;"> | ||
<span>{page.title}</span> | ||
<svg className="collapse-toggle clay-icon icon-monospaced"> | ||
<use xlinkHref="/images/icons/icons.svg#caret-bottom" /> | ||
</svg> | ||
</a> | ||
); | ||
} | ||
|
||
return ( | ||
<Link | ||
to={`${page.link}.html`} | ||
className="align-middle" | ||
> | ||
<span>{page.title}</span> | ||
</Link> | ||
); | ||
return ( | ||
<Link | ||
to={`${page.link}.html`} | ||
className="align-middle" | ||
> | ||
<span>{page.title}</span> | ||
</Link> | ||
); | ||
}; | ||
|
||
export default Navigation; | ||
export default Navigation; |
Oops, something went wrong.