Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Repository files navigation

Bloapi 🐧

API battery kit for nextjs blog

The Problem

  1. To start nextjs blog, making own cms api is essential. But that's pretty annoying process.
  2. Blog templates can solve this problem, but templates often contain too much unnecessary stuff.

Let's Play Practical

start with just what we need.

Api πŸš€ + Essential feature πŸ“¦

Perfect Fit for

  • Focus only on making UI
  • Choose tech stack oneself
  • Minimal, Customizable, Solid blog

Kind of meta

πŸš€ bloapi supports rich post meta option

required

---
title: post titlepreview: post previewauthor: post authorupdate: 2022/08/15 # < YYYY/MM/DD >color: "#A68A68"# < "{ HEX | rgba | rgb }" >tags: tag1, tag2 # split by comma
---

optional

---
series: javascript-1 # < {seriesTitle}-{order} >bannerUrl: /category/post # nextjs static image locationreference: ref1, ref2 # split by commapostpone: true # if true, post will not published
---

Kind of data

Let's look at the data we receive on each page by core api

  1. main: pages/index.tsx

Link to πŸ”­: https://{deploy-url}/

interfaceMainPageProps{latestPost: MetaType[]// βœ… main-page latest post// πŸ’‘ types/post/meta.tsmainCategory: CategoryInfoType[]// βœ… main-page displaying category// πŸ’‘ types/category/index.ts}
  1. category: pages/category.tsx

Link to πŸ”­: https://{deploy-url}/category

interfaceAllCategoryPageProps{allCategoryInfo: CategoryInfoType[]// βœ… all category of blog// πŸ’‘ types/category/index.ts}
  1. profile: pages/profile.tsx

Link to πŸ”­: https://{deploy-url}/profile

interfaceProfilePageProps{profileSource: string// βœ… extracted source of {blog-dir}/profile/description.mdx}
  1. {category}: pages/[category].tsx

Link to πŸ”­: https://{deploy-url}/{category}

interfaceCategoryPagePropsextendsCategoryInfoType{// βœ… specific category info// πŸ’‘ types/category/index.tslatestPost: MetaType[]// βœ… latest-post of specific category// πŸ’‘ types/post/meta.tslatestTag: string[]// βœ… latest-post-tag of specific categoryallSeries: SeriesType[]// βœ… series of specific category// πŸ’‘ types/post/series.ts}
  1. {category}/{page}: pages/[category]/[page]/index.tsx

Link to πŸ”­: https://{deploy-url}/{category}/{page}/

interfacePaginatedCategoryPagePropsextendsCategoryInfoType{allPost: MetaType[]// βœ… paginated-post of specific category// πŸ’‘ types/post/meta.tsallTag: string[]// βœ… paginated-post-tag of specific categorypage: number// βœ… current page numberisLastPage: boolean}
  1. {category}/{page}/{postTitle}: pages/[category]/[page]/[postTitle].tsx

Link to πŸ”­: https://{deploy-url}/{category}/{page}/{postTitle}

interfacePostPagePropsextendsPostWithControllerType{// βœ… specific post + controller [prev, next post]// πŸ’‘ types/post/index.tsseriesInfo: SeriesType|null// βœ… specific post's seriesInfo. nullable// πŸ’‘ types/post/series.ts}

Features

Essential πŸ“¦

  1. MDX full support with mdx-bundler
  2. CLI posting support
  3. SEO optimized with next-seo
  4. RSS/SITEMAP generation in scripts

More πŸš€

  1. First Load Js ⚑️ 44.5kb ⚑️, preact on production build
  2. Toc object generation on server-side
  3. Image optimized with next/image and support automatic-sizing
  4. Google-analytics full support in party-town-thread
  5. Code highlight with rehype-prism-plus
  6. Math expressionoptional support with katex
  7. Kind error message
  8. Kind tsdoc. Read doc with cmd+mouse hover shortcut in vscode

Get started

Click 🐧 Use This Template or 🐧 git clone

LICENSE

MIT

About

βš‘οΈπŸ”Œ Nextjs blog api starter kit. Don't think about handling data. Just draw it.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages