How to use the nextein/posts.withPostsFilterBy function in nextein

To help you get started, we’ve selected a few nextein examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elmasse / nextein-example / pages / post-with-next-prev.js View on Github external
{
              prev &&
              <a style="{styles.prevLink}"> <strong>&lt;</strong> Prev: {prev.data.title}</a>
            }
            {
              next &amp;&amp;
              <a style="{styles.nextLink}">Next: {next.data.title} <strong>&gt;</strong> </a>
            }
          
        
      
    )
  }
}

export default withPostsFilterBy(inCategory('post'))(withPost(Post))

const styles = {
  main: {
    fontFamily: '-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',
    fontWeight: 100,
    display: 'flex',
    flexDirection: 'column'
  },
  article: {
    display: 'flex',
    flexDirection: 'column',
    alignSelf: 'center',
    width: '60vw',
    position: 'relative'
  },
  paragraph: {
github elmasse / nextein-example / pages / stories.js View on Github external
import React,  { Component } from 'react'
import withPosts, { withPostsFilterBy, inCategory }  from 'nextein/posts'
import { Content } from 'nextein/post'
import Link from 'nextein/link'

const category = 'stories'
const withStories = withPostsFilterBy(inCategory(category, { includeSubCategories: true }))

class Stories extends Component {
  
  static async getInitialProps ({ query }) {
    if (query) {
      const { category } = query
      return {
        selected: category
      }
    }
  }

  render() {
    const { posts, selected } = this.props
    
    const stories = posts.filter(inCategory(selected))
github elmasse / nextein-example / pages / sub-section.js View on Github external
posts.sort(sortByDate)
  return (
    <main style="{styles.main}">
      
      
      <section style="{styles.section}">  
        {
          posts
          .map((post) =&gt; )
        }
      </section>
    </main>
  )
}

export default withPostsFilterBy(inCategory('sub-section', { includeSubCategories: true }))(Index)

const styles = {
  main: {    
    fontFamily: '-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif',
    fontWeight: 100,
    display: 'flex',
    flexDirection: 'column'
  },
  section: {
    display: 'flex',
    flexDirection: 'column',
    alignSelf: 'center',
    width: '60vw' 
  },
  navigation: {
    position: 'absolute',

nextein

A static site and blog generator based on Next.js

ISC
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis