gatsby-transformer-xsjzip

1.2.15 • Public • Published

gatsby-transformer-xsjzip

Parses xiaoshujiang's Markdown zip files Story Writer.

Install

npm install --save gatsby-transformer-xsjzip

How to use

  1. In your gatsby-config.js
// In your gatsby-config.js
plugins: [`gatsby-transformer-xsjzip`, {
    resolve: `gatsby-source-filesystem`,
    options: {
        path: `${__dirname}/src/xsjposts/blogs`,
        name: 'blogs',
    }
  }]
  1. Creating a Fold at src/xsjposts/blogs
  2. Putting xiaoshujiang's zip files at src/xsjposts/blogs

Parsing algorithm

It recognizes files with the following extensions as Markdown:

Each Zip file is parsed into a node of type StoryWriterMarkdown.

All frontmatter fields are converted into GraphQL fields. TODO link to docs on auto-inferring types/fields.

How to query

A sample GraphQL query to get MarkdownRemark nodes:

{
  allStoryWriterMarkdown {
    edges {
      node {
        html
        createDate
        updateDate
        title
        tags
        cover
        excerpt
        rawMarkdownBody
        toc
        slug
        docId
        zipPath
        docType
        customCss
        css
        meta {
          # Assumes you're using title in your frontmatter.
          title
          tags
        }
      }
    }
  }
}

/gatsby-transformer-xsjzip/

    Package Sidebar

    Install

    npm i gatsby-transformer-xsjzip

    Weekly Downloads

    4

    Version

    1.2.15

    License

    MIT

    Unpacked Size

    34.6 kB

    Total Files

    10

    Last publish

    Collaborators

    • suziwen