notion-blog | js site using new SSG support with a Notion backed blog | Frontend Framework library
kandi X-RAY | notion-blog Summary
kandi X-RAY | notion-blog Summary
This is an example Next.js project that shows Next.js' upcoming SSG (static-site generation) support using Notion's private API for a backend. Note: This example uses the experimental SSG hooks only available in the Next.js canary branch! The APIs used within this example will change over time. Since it is using a private API and experimental features, use at your own risk as these things could change at any moment. Live Example hosted on Vercel:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of notion-blog
notion-blog Key Features
notion-blog Examples and Code Snippets
Community Discussions
Trending Discussions on notion-blog
QUESTION
"Not building properly" meaning "not finishing building at all". I've set up a very basic blog project with dynamic SSR which fetches data from the Notion-API to generate static blog pages. Everything works fine when I'm running it in next dev
- however when trying to build the project, it runs into an endless loop without any errors shown.
One thought I had was the following:
If I understand the sequence of everything correctly, Next.js already tries building the static sites during next build
. The dynamic site generation relies on an API that I have also coded within the same project, which forwards requests to Notion in order to obfuscate secrets. Obviously no local API will be active during the build, which I am guessing is the error I'm running into?
To illustrate - here's the code for the pages that are to be generated:
...ANSWER
Answered 2022-Mar-13 at 13:18I solved this one by thinking hard about whether an API was actually necessary. Since I already have the Notion-keys accessible project-wide in process.env
, there's no real need to build up an API. Moving the query-logic to helper-functions that I can simply call has solved about every problem I faced.
Learning: Don't just build APIs for everything. It might just make your life harder.
QUESTION
Some context to my problem: I'm wanting to write a firebase function including Express that sits in between a users' browser and the Notion API. I drafted up some code for minimal functionality which works with the local emulators firebase provides. I've tested the two routes locally, both are served properly and execute without error.
When I try to deploy the function all goes well. However, upon calling the route it responds with a 403 error page. No other errors logged, just this "Error: Forbidden" disclaimer.
Am I missing something really obvious here or using functions outside of their intended scope?
...ANSWER
Answered 2022-Feb-25 at 23:23I managed to fix it!
The 403 Error did originate from the cloud function itself. This answer explains it quite well - it's an issue of missing permissions when trying to call a function which is resolved by adding the Cloud Functions Invoker
permission to the allUsers
user of your cloud function.
QUESTION
I'm creating my portfolio using Notion API, Next.js and Tailwind thanks to this wonderful work : https://github.com/samuelkraft/notion-blog-nextjs
However, as you may know, images hosted on Notion has an expiration time.
I tried to use
but if I upload a cover on my Notion page from an external link, all my code breaks.
I had a look on this documentation : https://developers.notion.com/changelog/page-icons-cover-images-new-block-types-and-improved-page-file-properties
but I don't know how to mention it's an external link.
Do you have any idea how I can solve this issue?
Thanks a lot in advance
...ANSWER
Answered 2022-Jan-26 at 23:25You need to use src={cover.external.url}
as mention in docs https://developers.notion.com/changelog/page-icons-cover-images-new-block-types-and-improved-page-file-properties.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install notion-blog
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page