Skip to content

Commit

Permalink
update everything
Browse files Browse the repository at this point in the history
  • Loading branch information
mjlescano committed Feb 7, 2018
1 parent 641db3a commit 7cdf8c3
Show file tree
Hide file tree
Showing 6 changed files with 2,778 additions and 2,547 deletions.
6 changes: 1 addition & 5 deletions components/Anchor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import { Component } from 'react'
import jump from 'jump.js'
import throttle from 'lodash.throttle'
import Router from 'next/router'
Expand Down Expand Up @@ -58,7 +58,3 @@ export default class Anchor extends Component {
)
}
}

Anchor.propTypes = {
id: React.PropTypes.string
}
4 changes: 2 additions & 2 deletions components/Header.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from 'next/link'

export default (props) => (
<header>
export default ({ style }) => (
<header style={style}>
<style jsx>{`
header {
position: relative;
Expand Down
6 changes: 3 additions & 3 deletions components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Header from './Header'
import Footer from './Footer'
import Anchor from './Anchor'

export default (props) => (
export default ({ children }) => (
<div>
<Head>
<meta name='viewport' content='initial-scale=1.0, width=device-width' />
Expand Down Expand Up @@ -84,10 +84,10 @@ export default (props) => (
<StickyContainer>
<div style={{ paddingBottom: '47px' }}>
<Sticky>
<Header />
{({ style }) => <Header style={style} />}
</Sticky>
</div>
{ props.children }
{ children }
<Footer />
</StickyContainer>
</div>
Expand Down
29 changes: 20 additions & 9 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
const path = require('path')
const fs = require('fs')

const getWorksPages = () => {
const worksFolder = path.resolve(__dirname, 'pages', 'works')
const works = {}

fs.readdirSync(worksFolder).forEach((file) => {
if (!file.endsWith('.js')) return
const work = `/works/${file.slice(0, -3)}`
works[work] = { page: work }
})

return works
}

module.exports = {
exportPathMap: function () {
return {
'/': { page: '/' },
'/works/demos': { page: '/works/demos' },
'/works/goodpeople': { page: '/works/goodpeople' },
'/works/piet': { page: '/works/piet' },
'/works/tril': { page: '/works/tril' }
}
}
exportPathMap: () => ({
'/': { page: '/' },
...getWorksPages()
})
}
Loading

0 comments on commit 7cdf8c3

Please sign in to comment.