Total Pageviews

Monday, 22 December 2025

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

 

首先fork此项目https://github.com/rakarmp/PersonalBlog,我fork后的项目地址是https://github.com/briteming/rpb, 
然后访问https://github.com/briteming/rpb/tree/master/posts,新建源帖fh.md,内容为:

---
title: "战马"
date: "2025-12-22T22:29:00"
---

此处写视频的嵌入代码

( 详见https://github.com/briteming/rpb/blob/master/posts/fh.md?plain=1)

 然后访问vercel.com/new ,导入项目https://github.com/briteming/rpb。

然后,点击deploy按钮,等待部署完成,部署完成后,我得到网址https://rpb-gilt.vercel.app/

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

 项目地址:

https://github.com/rakarmp/PersonalBlog

 https://github.com/briteming/rpb

演示博客:

https://rpb-gilt.vercel.app/

本来,帖子https://rpb-gilt.vercel.app/posts/fh 是不显示视频的。解决办法:

访问 https://github.com/briteming/rpb/blob/master/lib/posts.tsx ,编辑posts.tsx -

在第59行,把 .use(html) 改为.use(html, { sanitize: false })

 改好2分钟后,访问帖子https://rpb-gilt.vercel.app/posts/fh ,发现能显示视频了。

 


No comments:

Post a Comment