Total Pageviews

Saturday, 29 November 2025

搭建基于nextjs的静态博客程序snrb


首先fork此项目https://github.com/stevenspads/next-app-router-blog,我fork后的项目地址是https://github.com/briteming/snrb ,
然后访问https://github.com/briteming/snrb/tree/main/content/posts,新建源帖test.mdx,内容为

---
title: 测试
description: 这是一篇文章
date: "2023-06-01"
category: misc
image: /posts/deploying-nextjs-apps.jpg
---

这是测试。

看看如何?

( 详见https://github.com/briteming/snrb/blob/main/content/posts/test.mdx?plain=1)

 然后访问vercel.com/new ,导入项目https://github.com/briteming/snrb,点击deploy按钮,等待部署完成,部署完成后,我得到网址https://snrb.vercel.app/

 新建源帖后,博客网站2分钟内就会更新。

 项目地址:

https://github.com/stevenspads/next-app-router-blog

 https://github.com/briteming/snrb

演示博客:https://snrb.vercel.app/ ,可惜发表的帖子并未按时间顺序排列。

p.s:  为了让发表的帖子按时间顺序排列,可以这样做:

我仔细观察了 https://snrb.vercel.app/里面的帖子的排列规律,是按字母顺序abcd...,然后按数字12345...,从页面的上部往下排列的,我发表的第1个帖子的源帖文件是test.mdx, 第2个帖子的源帖文件是test2.mdx,那么第2个帖子就会排在第1个帖子的下面。把之前发表的 ce.mdx删除,重新发表源帖tesu-ce.mdx; 因为u排在t的后面,所以源帖tesu-ce.mdx对应的帖子tesu-ce就会排在

 test2.mdx所对应的帖子test2的下面。

 把之前发表的fh.mdx删除,重新发表源帖tesu-fh.mdx; 因为f排在c的后面,所以源帖tesu-fh.mdx对应的帖子tesu-fh就会排在 tesu-ce.mdx所对应的帖子tesu-ce的下面.

不过最近发表的帖子一律在页面的底部。 

No comments:

Post a Comment