mirror of
				https://github.com/mastermindzh/rickvanlieshout.com
				synced 2025-11-04 02:29:46 +01:00 
			
		
		
		
	Update
This commit is contained in:
		@@ -7,21 +7,21 @@ import '../static/css/reset.css'
 | 
			
		||||
import '../static/css/typography.css'
 | 
			
		||||
 | 
			
		||||
class Template extends React.Component {
 | 
			
		||||
  render() {
 | 
			
		||||
    const { location, children } = this.props
 | 
			
		||||
    
 | 
			
		||||
    return (
 | 
			
		||||
      <div className='wrapper'>
 | 
			
		||||
        {children}
 | 
			
		||||
      </div>
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
    render() {
 | 
			
		||||
        const {location, children} = this.props
 | 
			
		||||
 | 
			
		||||
        return (
 | 
			
		||||
            <div className='wrapper'>
 | 
			
		||||
              { children }
 | 
			
		||||
            </div>
 | 
			
		||||
            );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Template.propTypes = {
 | 
			
		||||
  children: React.PropTypes.any,
 | 
			
		||||
  location: React.PropTypes.object,
 | 
			
		||||
  route: React.PropTypes.object,
 | 
			
		||||
    children: React.PropTypes.any,
 | 
			
		||||
    location: React.PropTypes.object,
 | 
			
		||||
    route: React.PropTypes.object,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default Template
 | 
			
		||||
@@ -11,70 +11,53 @@ import SidebarLeft from '../components/SidebarLeft'
 | 
			
		||||
import BlogContent from '../components/BlogContent'
 | 
			
		||||
 | 
			
		||||
class BlogIndex extends React.Component {
 | 
			
		||||
  render() {
 | 
			
		||||
    const pageLinks = []
 | 
			
		||||
    // Sort pages.
 | 
			
		||||
    const sortedPages = sortBy(this.props.route.pages, (page) =>
 | 
			
		||||
      access(page, 'data.date')
 | 
			
		||||
    ).reverse()
 | 
			
		||||
    sortedPages.forEach((page) => {
 | 
			
		||||
      if (access(page, 'file.ext') === 'md' && access(page, 'data.layout') === 'post') {
 | 
			
		||||
        const title = access(page, 'data.title') || page.path
 | 
			
		||||
        const description = access(page, 'data.description')
 | 
			
		||||
        const datePublished = access(page, 'data.date')
 | 
			
		||||
        const category = access(page, 'data.category')
 | 
			
		||||
    render() {
 | 
			
		||||
        const pageLinks = []
 | 
			
		||||
        // Sort pages.
 | 
			
		||||
        const sortedPages = sortBy(this.props.route.pages, (page) => access(page, 'data.date')
 | 
			
		||||
        ).reverse()
 | 
			
		||||
        sortedPages.forEach((page) => {
 | 
			
		||||
            if (access(page, 'file.ext') === 'md' && access(page, 'data.layout') === 'post') {
 | 
			
		||||
                const title = access(page, 'data.title') || page.path
 | 
			
		||||
                const description = access(page, 'data.description')
 | 
			
		||||
                const datePublished = access(page, 'data.date')
 | 
			
		||||
                const category = access(page, 'data.category')
 | 
			
		||||
 | 
			
		||||
        pageLinks.push(
 | 
			
		||||
          <div className='blog-post'>
 | 
			
		||||
            <time dateTime={moment(datePublished).format('MMMM D, YYYY')}>{moment(datePublished).format('MMMM YYYY')}</time>
 | 
			
		||||
            <span
 | 
			
		||||
              style={{
 | 
			
		||||
                padding: '5px'
 | 
			
		||||
              }}
 | 
			
		||||
            >
 | 
			
		||||
            </span>
 | 
			
		||||
            <span className='blog-category'>{category}</span>
 | 
			
		||||
            <h2>
 | 
			
		||||
              <Link
 | 
			
		||||
                style={{
 | 
			
		||||
                  borderBottom: 'none',
 | 
			
		||||
                }} 
 | 
			
		||||
                to={link(page.path)}
 | 
			
		||||
              >
 | 
			
		||||
                {title}
 | 
			
		||||
              </Link>
 | 
			
		||||
            </h2>
 | 
			
		||||
            <p dangerouslySetInnerHTML={{__html: description}}/>
 | 
			
		||||
            <Link
 | 
			
		||||
              className='readmore'
 | 
			
		||||
              to={link(page.path)}
 | 
			
		||||
            >
 | 
			
		||||
              Read
 | 
			
		||||
            </Link>
 | 
			
		||||
          </div>
 | 
			
		||||
        )
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
                pageLinks.push(
 | 
			
		||||
                    <div className='blog-post'>
 | 
			
		||||
                      <time dateTime={ moment(datePublished).format('MMMM D, YYYY') }>
 | 
			
		||||
                        { moment(datePublished).format('MMMM YYYY') }
 | 
			
		||||
                      </time>
 | 
			
		||||
                      <span style={ {    padding: '5px'} }></span>
 | 
			
		||||
                      <span className='blog-category'>{ category }</span>
 | 
			
		||||
                      <h2><Link style={ {    borderBottom: 'none',} } to={ link(page.path) } > { title } </Link></h2>
 | 
			
		||||
                      <p dangerouslySetInnerHTML={ {    __html: description} } />
 | 
			
		||||
                      <Link className='readmore' to={ link(page.path) }> Read
 | 
			
		||||
                      </Link>
 | 
			
		||||
                    </div>
 | 
			
		||||
                )
 | 
			
		||||
            }
 | 
			
		||||
        })
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
      <DocumentTitle title={config.siteTitle}>
 | 
			
		||||
        <div>
 | 
			
		||||
          <SidebarLeft {...this.props}/>
 | 
			
		||||
          <div className='content'>
 | 
			
		||||
            <div className='main'>
 | 
			
		||||
              <div className='main-inner'>
 | 
			
		||||
                {pageLinks}
 | 
			
		||||
        return (
 | 
			
		||||
            <DocumentTitle title={ config.siteTitle }>
 | 
			
		||||
              <div>
 | 
			
		||||
                <SidebarLeft {...this.props}/>
 | 
			
		||||
                <div className='content'>
 | 
			
		||||
                  <div className='main'>
 | 
			
		||||
                    <div className='main-inner'>
 | 
			
		||||
                      { pageLinks }
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </DocumentTitle>
 | 
			
		||||
    )
 | 
			
		||||
  }
 | 
			
		||||
            </DocumentTitle>
 | 
			
		||||
        )
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
BlogIndex.propTypes = {
 | 
			
		||||
  route: React.PropTypes.object,
 | 
			
		||||
    route: React.PropTypes.object,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default BlogIndex
 | 
			
		||||
		Reference in New Issue
	
	Block a user