Skip to content

pickyzz/blog-rebuild

Repository files navigation

Powered by Astro & Notion

customized by Pickyzz

Requirements

  • Node.js and npm (or yarn, pnpm, bun)

Work with notion as CMS

  • Duplicate [This] Notion template and do not edit the table's name

  • Rename .env.example to .env and add your NOTION_KEY key and DATABASE_ID

  • To sync posts for developing use npm run sync or npm run sync:published

  • use npm run generate get all published posts and build for production

Developing

Run the following command on your local environment:

Then, you can run locally in development mode with live reload:

npm run dev

Open http://localhost:4321 with your favorite browser to see your project.

Deploy to production (manual)

You can create an optimized production build with:

npm run build

or

npm run generate

Now, your blog is ready to be deployed. All generated files are located at dist folder, which you can deploy the folder to any hosting service you prefer.

🧞 All Commands

Note: run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:3000
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run clean Remove ./dist folder
npm run format Run ESLint and report styling error
npm run sync Sync all posts from notion database
npm run sync:publised Sync only published post from notion database
npm run generate Sync published post and build static site for deploying