0.0.8 • Published 1 year ago

@akiboi/notion-sync-astro v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Notion to Astro Sync: Automate Your Blog Workflow

Overview

This package seamlessly synchronizes articles from Notion to your Astro blog. It converts articles to MDX format and downloads referenced images locally.

Key Features:

  • Automatic synchronization from Notion database
  • Article conversion to MDX format
  • Local image download for articles
  • Draft and publish workflow support
  • Extensive configuration options

Getting Started:

  1. Prepare Notion Database:

Create a database with the following columns:

  • ID: Unique key (auto-generated)
  • Title: Article title
  • Hero Image: Main image for the article
  • Menu: Article category
  • Slug: Article URL
  • Description: Article summary
  • Tags: Article tags
  • Author: Article author
  • Status: Draft, Scheduled, Published
  • Published Date: Article publish date (auto-set)
  • Updated Date: Article update date (auto-set)
  • Created By: Article creator (auto-set)
  • Created Date: Article creation date (auto-set)
  1. Package Installation:
npm install @akiboi/notion-sync-astro
  1. Configuration:

Configure the following in index.ts:

  • Notion API key
  • Database ID
  • Article output directory
  • Image output directory
  • Other options
  1. Run:
   export NOTION_API_KEY="Notion API Key"
   export NOTION_DB_ID="Notion Database ID"

example.ts

import { NotionSyncAstro } from '@akiboi/notion-sync-astro';

const nsa = new NotionSyncAstro();
nsa.start();
  1. Using in Astro:

Articles are saved in MDX format. Set the title, publish date, update date, hero image, description, tags, and other attributes in the frontmatter.

---
title: 'Astro Blog Creation: From Setup to Article Display'
publishedDate: 2024-03-17
updatedDate: 2024-03-20
heroImage: astroBlog01.jpg
description: 'This article provides a detailed explanation of the entire process of creating a blog with Astro, from setup to article display. If you have experience with Nuxt or Gatsby, the transition should be relatively smooth.'
name: akibo.I
tags: [software, astro]
---

Limitations:

  • As a beta release, unexpected termination or errors in the generated articles may occur.
  • Only some list formatting is supported for Notion rich_text.
  • Large data processing may not be supported.
  • Error handling for Notion API is omitted.

Future Plans:

  • Automatic article update triggered by Notion status change
  • Draft article preview functionality
  • Automatic deployment to production environment

Developer:

akibo.I

šŸ  Homepage

Additional Notes:

This package is a useful tool for users who want to streamline their blog management workflow by connecting Notion and Astro. We encourage you to give it a try!

Change Log:

  • 2023-11-14: Initial release
  • 2023-03-24: bug fix
0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago