All Projects → ijjk → Notion Blog

ijjk / Notion Blog

Licence: mit
A Next.js site using new SSG support with a Notion backed blog

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Notion Blog

notion-nextjs-blog
A starter blog template powered by Next.js, Notion and Tailwind CSS.
Stars: ✭ 25 (-98.93%)
Mutual labels:  nextjs, notion, vercel
dev-cover
🌐 Get and publish your developer portfolio with just your username
Stars: ✭ 155 (-93.37%)
Mutual labels:  nextjs, vercel
portfolio
My personal portfolio website, proudly built with Next.js, TypeScript and Tailwind
Stars: ✭ 165 (-92.95%)
Mutual labels:  nextjs, vercel
website
My portfolio 👋
Stars: ✭ 232 (-90.08%)
Mutual labels:  nextjs, vercel
jahir.dev
My personal website 💎 – Built using Next.js, TypeScript, MDX, contentlayer, Notion and Stitches styled components
Stars: ✭ 119 (-94.91%)
Mutual labels:  notion, vercel
notion-custom-domain
📝 Custom domains for your public Notion pages
Stars: ✭ 23 (-99.02%)
Mutual labels:  notion, vercel
onlysetups
OnlyFans, but for pictures of desk setups.
Stars: ✭ 82 (-96.49%)
Mutual labels:  nextjs, vercel
nobelium
A static blog build on top of Notion and NextJS, deployed on Vercel.
Stars: ✭ 1,790 (-23.47%)
Mutual labels:  notion, vercel
wefootwear-store
next js footwear store e-commerce 🚀🚀🚀
Stars: ✭ 17 (-99.27%)
Mutual labels:  nextjs, vercel
static-template-nextjs
A Next.js based template of a blog built using the Collected Notes API
Stars: ✭ 19 (-99.19%)
Mutual labels:  nextjs, vercel
Next.js
The React Framework
Stars: ✭ 78,384 (+3251.18%)
Mutual labels:  nextjs, vercel
Swr
React Hooks for data fetching
Stars: ✭ 20,348 (+769.94%)
Mutual labels:  nextjs, vercel
yearn-comms
Collection of communication, announcements, tweets, newsletters, and other articles about Yearn and a hosted blog for all translation contributors.
Stars: ✭ 16 (-99.32%)
Mutual labels:  nextjs, vercel
Personal-Site-Gourav.io
My personal site & blog made with NextJS, Typescript, MDX, Tailwind CSS. Deployed on Vercel : https://gourav.io
Stars: ✭ 64 (-97.26%)
Mutual labels:  nextjs, vercel
platforms
A template for site builders and low-code tools.
Stars: ✭ 1,156 (-50.58%)
Mutual labels:  nextjs, vercel
Notion Clone
Stars: ✭ 2,048 (-12.44%)
Mutual labels:  nextjs, notion
Next Dark Mode
🌑 Enable dark mode for Next.js apps
Stars: ✭ 133 (-94.31%)
Mutual labels:  nextjs
Nextjs Material Kit
NextJS version of Material Kit React by Creative Tim
Stars: ✭ 141 (-93.97%)
Mutual labels:  nextjs
Next Js Blog Boilerplate
🚀 Nextjs Blog Boilerplate is starter code for your blog based on Next framework. ⚡️ Made with Nextjs, TypeScript, ESLint, Prettier, PostCSS, Tailwind CSS.
Stars: ✭ 134 (-94.27%)
Mutual labels:  nextjs
R3f Next Starter
Repo is moving to https://github.com/pmndrs/react-three-next
Stars: ✭ 137 (-94.14%)
Mutual labels:  nextjs

Notion Blog

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: https://notion-blog.vercel.app/

Getting Started

To view the steps to setup Notion to work with this example view the post at https://notion-blog.vercel.app/blog/my-first-post or follow the steps below.

Deploy Your Own

Deploy your own Notion blog with Vercel.

Deploy with Vercel

or

  1. Clone this repo git clone https://github.com/ijjk/notion-blog.git
  2. Configure project with vc
  3. Add your NOTION_TOKEN and BLOG_INDEX_ID as environment variables in your project. See here for how to find these values
  4. Do final deployment with vc

Note: if redeploying with vc locally and you haven't made any changes to the application's source and only edited in Notion you will need use vc -f to bypass build de-duping

Creating Your Pages Table

Note: this is auto run if a table isn't detected the first time visiting /blog

Using the Pre-Configured Script

  1. Create a blank page in Notion
  2. Clone this repo git clone https://github.com/ijjk/notion-blog.git
  3. Install dependencies cd notion-blog && yarn
  4. Run script to create table NOTION_TOKEN='token' BLOG_INDEX_ID='new-page-id' node scripts/create-table.js See here for finding the id for the new page

Manually Creating the Table

  1. Create a blank page in Notion
  2. Create a inline table on that page, don't use a full page table as it requires querying differently
  3. Add the below fields to the table

The table should have the following properties:

  • Page: this the blog post's page
  • Slug: this is the blog post's slug relative to /blog, it should be a text property
  • Published: this filters blog posts in production, it should be a checkbox property
  • Date: this is when the blog post appears as posted, it should be a date property
  • Authors: this is a list of Notion users that wrote the post, it should be a person property

Example Blog Posts Table

Getting Blog Index and Token

To get your blog index value, open Notion and Navigate to the Notion page with the table you created above. While on this page you should be able to get the page id from either:

  • the URL, if the URL of your page is https://www.notion.so/Blog-S5qv1QbUzM1wxm3H3SZRQkupi7XjXTul then your BLOG_INDEX_ID is S5qv1QbU-zM1w-xm3H-3SZR-Qkupi7XjXTul
  • the loadPageChunk request, if you open your developer console and go to the network tab then reload the page you should see a request for loadPageChunk and in the request payload you should see a pageId and that is your BLOG_INDEX_ID

To get your Notion token, open Notion and look for the token_v2 cookie.

Creating Blog Posts

  1. In Notion click new on the table to add a new row
  2. Fill in the Page name, slug, Date, and Authors
  3. At the top of the content area add the content you want to show as a preview (keep this under 2 paragraphs)
  4. Add a divider block under your preview content
  5. Add the rest of your content under the divider block

Running Locally

To run the project locally you need to follow steps 1 and 2 of deploying and then follow the below steps

  1. Install dependencies yarn
  2. Expose NOTION_TOKEN and BLOG_INDEX_ID in your environment export NOTION_TOKEN='<your-token>'and export BLOG_INDEX_ID='<your-blog-index-id>' or set NOTION_TOKEN="<your-token>" && set BLOG_INDEX_ID="<your-blog-index-id>" for Windows
  3. Run next in development mode yarn dev
  4. Build and run in production mode yarn build && yarn start

Credits

  • Guillermo Rauch @rauchg for the initial idea
  • Shu Ding @shuding_ for the design help
  • Luis Alvarez @luis_fades for design help and bug catching
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].