Giter Site home page Giter Site logo

pcarion / gatsby-source-notionso Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 4.0 2.03 MB

A Gatsby source plugin for sourcing data into your Gatsby application using Notion.so as a backend.

License: BSD 3-Clause "New" or "Revised" License

JavaScript 2.16% TypeScript 97.84%

gatsby-source-notionso's People

Contributors

darioghilardi avatar dependabot[bot] avatar iansinnott avatar pcarion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gatsby-source-notionso's Issues

use notion page icon

Export the page icon (emoji) that you can set in notion as a property of the page (pageIcon)

From notion we get:

format: { page_icon: '๐Ÿ‰' },

Not sure to understand the imageNodes error

Hey @pcarion

Thank for all your work!
I was really curious to give it a try but looks like I've found a blocker :/

 ERROR #85923  GRAPHQL
There was an error in your GraphQL query:
Cannot query field "imageNodes" on type "NotionPageBlog".

File: src/templates/page.js:46:7

This is the error your referenced on your FAQ, but I am not sure how to fix it.
I added an image to my root page, but looks like it didn't make any change.

Any tip to debug this issue?

Thanks

plugin doesn't work if no images in the pages

error log is:

There was an error in your GraphQL query:

Cannot query field "allNotionPageAssetBlog" on type "Query".

If you don't expect "allNotionPageAssetBlog" to exist on the type "Query" it is most likely a typo.
However, if you expect "allNotionPageAssetBlog" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "allNotionPageAssetBlog" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: ../theme-notion/src/templates/page.js:51:5

add rendering API for blocks

blocks are currently hard to parse for rendering. Would be nice to have an agnostic API to render those blocks

rendering throws if the page contains a toggle

The fix is to ignore for now 'toggle' blocks
A toggle block is defined like that:

{ role: 'reader',
   value:
    { id: '91629d65-f538-4f2e-9c7b-c40a8320861c',
      version: 42,
      type: 'toggle',
      properties: { title: [ [ 'toggle list?' ] ] },
      content:
       [ 'dd651889-8ba1-48ef-a26b-d69d484243b0',
          'c70c17b9-8d74-4c66-8000-c89a50f1088a' ],

but.. the block ids are not part of the blocks returned with the page.

refactor project to be a multi repo project

To test the example websites with a npm link doesn't work as the files of the examples are being processed twice.
A multi repo project structure should solve that issue.

Support For Notion Databases (Collections)

Hello, is this already possible? This plugin seems pretty useful. I pulled some data from some public pages and it worked wonderfully. However, databases and their sub-blocks don't get parsed into results as far as I can tell.

  • Is this already supported? Maybe I just missed something, because I see that the collection view IS returned in debug output (debug: true).
  • If not, any idea where the filtering or lack of parsing is going on? I could potentially PR this. Any direction would be appreciated.

Cache issues with uploaded images

Hello,
thanks a lot for the effort you put into this plugin.
I stumbled upon what I think is a little bug with images, these are the steps to reproduce the issue:

  • Upload an image to a Notion page (don't use one from Unsplash, upload one from your computer).
  • yarn start
  • It works
  • Restart the server
  • Error: Invariant Violation: Encountered an error trying to infer a GraphQL type for: localFile__ _NODE. There is no corresponding node with the id field matching: "4b8e0ad5-41c1-5781-bff6-ee4 c4deeed6b".

It seems the cache for Gatsby nodes is stepping in and is messing up with node ids. If I clean the cache between runs I don't get the error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.