Giter Club home page Giter Club logo

gaurav241 / blog Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 3.32 MB

This project integrates Notion with Next.js to streamline blogging. It dynamically fetches content and enhances user experience with animations and SEO. Gone are the days of complex content management systems and tedious manual updates. With this integration, bloggers can focus on crafting compelling content while enjoying the flexibility.

Home Page: https://gauravblog.vercel.app

License: MIT License

JavaScript 2.93% CSS 3.02% TypeScript 94.04%
blog-cms blog-notion notion-blog blog-template dynamic-blog dynamic-blog-cms notion blog-dynamic blog-app blog-application

blog's Introduction

Blog Website with Notion Integration

Table of Contents

Introduction

This repository hosts a Next.js-based blog website with content management capabilities powered by Notion. Leveraging the Notion API, users can seamlessly create and manage blog content within the Notion platform, which is then dynamically fetched and displayed on the website.

Deployed Website

The website is deployed and accessible at https://gauravblog.vercel.app/.

Screenshots

UI/UX

Dark Mode Light Mode
Dark Home Light Home
Home: Landing page of the blog website. Home: Landing page of the blog website.
Dark Post 1 Light Post 1
Post 1: Example blog post with content. Post 1: Example blog post with content.
Dark Post 2 Light Post 2
Post 2: Another blog post showcasing different content. Post 2: Another blog post showcasing different content.
Dark Footer Light Footer
Footer: Footer section of the blog website. Footer: Footer section of the blog website.

Notion CMS

Home

Home

Blog

Blog

Features

  • Dynamic Content: Fetches content dynamically from Notion, enabling real-time updates without redeploying.
  • Browse by Categories: Users can browse blog posts by categories, enhancing content discoverability.
  • Related Topic Blogs: Displays related topic blogs at the end of each blog post, encouraging further exploration.
  • Table of Contents: Provides a table of contents beside every post for easy navigation within the content.
  • Smooth Animations: Utilizes smooth animations to enhance user experience and engagement.
  • Dark and Light Mode: Supports both dark and light modes for improved readability and user preference.
  • SEO Optimized: Implemented SEO best practices to ensure better visibility on search engines.

Technologies Used

  • Next.js: React framework for SSR and routing.
  • Tailwind CSS: Utility-first CSS framework.
  • Notion Client: Integration with the Notion API.
  • React Notion X: Renderer for Notion content.
  • Axios: HTTP client for API requests.
  • React Icons: Library for customizable icons.
  • Recoil: State management library.
  • Plaiceholder: Image placeholder generation.
  • Sharp: Image processing library.

Installation

Prerequisites

Before installing, ensure you have the following installed:

  • Node.js (preferably the latest stable version)
  • npm package manager (you can use yarn, but this guide assumes you're using npm)

Steps

  1. Clone the repository:
git clone https://github.com/Gaurav241/Blog.git
  1. Navigate to the project directory:
cd Blog
  1. Install dependencies:
npm install
  1. Set up environment variables:

Copy the .env.example file to .env:

cp .env.example .env

Then, fill in the environment variables in the .env file:

  • NOTION_DATABASE_ID: Your Notion database ID.
  • NOTION_AUTH_TOKEN: Your Notion authentication token.
  • API_SECRET: Choose any secure password for route handler authentication.
  • SITE_URL: The URL of your website.

For Development:

Set SITE_URL to http://localhost:3000 during development.

For Production:

Set SITE_URL to your production website URL. Ensure it starts with https:// for secure connections.

  1. Setting Up Notion Integration

To integrate your Notion content with this blog website, follow these steps:

I. Duplicate Notion Blog Template: Find and duplicate the blog template you want to use in your Notion workspace. Notion Blog template

II. Retrieve Notion Database ID: Open the duplicated template, and copy the string of characters from the URL after Blog-. This string is your Notion database ID.

III. Publish Notion Page: Ensure that the Notion page containing your blog content is published by clicking on the "Share" button and selecting "Publish."

IV. Obtain Notion Authentication Token: While logged into Notion, right-click anywhere on the page, select "Inspect," navigate to the "Application" tab, and find the token_v2 cookie. Copy its value.

  1. Start the development server:
npm run dev

Open http://localhost:3000 in your browser to view the website.

  1. Build and run for production:

When you're ready to deploy your portfolio:

npm run build
npm run start

Contributions

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

License

This project is licensed under the MIT License, granting users the freedom to use, modify, and distribute the software for both commercial and non-commercial purposes while retaining the copyright notice and license terms.

blog's People

Contributors

dependabot[bot] avatar gaurav241 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

yuguxx siam3310

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.