Total Pageviews

Sunday, 25 January 2026

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


首先fork此项目https://github.com/leojohn117/next-blog,我fork后的项目地址是
https://github.com/briteming/ljnb, 
然后访问https://github.com/briteming/ljnb/tree/main/_posts,新建源帖fh.md,内容为:

---
title: "战马"
excerpt: "这是一个视频"
coverImage: "/blog/post1.png"
date: "2025-12-28T11:01:07.322Z"
author: "ym"
---

此处写视频的嵌入代码

( 详见https://github.com/briteming/ljnb/blob/main/_posts/fh.md?plain=1)

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

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

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

 项目地址:

https://github.com/leojohn117/next-blog

https://github.com/briteming/ljnb

演示博客:https://ljnb-self.vercel.app/blog

https://ljnb-self.vercel.app/posts/fh 原本不能显示视频,解决办法:

访问https://github.com/briteming/ljnb/blob/main/lib/markdownToHtml.ts ,修改第5行的

 .use(html) .use(html, { sanitize: false })

其他地方不要改。

2-3分钟后,再访问https://ljnb-self.vercel.app/posts/fh ,发现能显示视频了。


 

 

No comments:

Post a Comment