I wrote a new blog using Next.js App router #132
zhangyu1818
announced in
en
Replies: 1 comment
-
Blogs are good. They look good. Keep going. 💪 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Before I dive into the development journey of my new blog, you might want to check it out first at my blog.
Back in 2020, React introduced Server Components. I was amazed by the possibility of writing asynchronous components.
Writing async components isn't groundbreaking per se; there was a short-lived framework before that used JSX syntax and allowed async components even on the client side.
What was novel, however, was React's support for async components, even though they could only run on the server. At that time, there wasn't a stable framework to leverage this feature. By coincidence, a new project last year required using
Next.js
. On my recommendation, we adopted the officialApp Router
, seamlessly integrating React Server Components.To master React Server Components, I decided to rewrite my blog using the
App Router
. Previously, my blog was built withAstro
. Here’s a preview of the old blog.My requirements for the new blog were:
App Router
and Server Components to optimize performance.Regarding the first point, Server Components performed admirably.
For the second point, I am currently using:
shadcn/ui
, norradix-ui
.React
code within Markdown.The highlights are
MDX
andshiki
. I aim to include as many code examples as possible in my posts, allowing readers to interact with them.shiki
supports numerous plugins likediff
,focus
,highlight
, and the best one istwoslash
, which makes code blocks more user-friendly.MDX
andshiki
are a match made in heaven. All these effects can run server-side without bundling anyjs
.For the third point, I employed a novel approach:
Using GitHub Discussions as the Blog Backend
I haven’t seen anyone else using this method. I find it more blog-friendly than using GitHub Issues. It has several distinct advantages:
Discussions
input box uploads it to GitHub automatically.Moreover, GitHub provides a robust
GraphQL API
, enabling blog development with any front-end technology, even a console app.For the fourth point:
I studied Bento design on Dribbble, drawing inspiration from various Bento-style blogs.
Current missing features in my blog:
shiki
andtwoslash
stylesIf you previewed my blog and found it appealing, you can visit my GitHub repository. It supports one-click deployment and includes a simple forking tutorial.
Beta Was this translation helpful? Give feedback.
All reactions