首先fork此项目 https://github.com/leerob/next-mdx-blog,我fork后,得到的项目地址是https://github.com/briteming/nmb/ 。
访问https://github.com/briteming/nmb/tree/main/app/n ,在此处,创建以某个slug命名的目录,比如fh,然后在该目录https://github.com/briteming/nmb/tree/main/app/n/fh/下,创建page.mdx文件,内容为:
export const metadata = { title: '战马', alternates: { canonical: '/n/fh', }, };
## 战马
此处写正文或html codes.
(详见https://github.com/briteming/nmb/blob/main/app/n/fh/page.mdx?plain=1)
然后,访问https://github.com/briteming/nmb/tree/main/app,编辑该目录里的page.mdx,修改第7行的 ## examples为 ## posts
在该文件的第8行的上一行添加:
- [战马](/n/fh)
然后,访问vercel.com/new ,导入项目https://github.com/briteming/nmb/
Build Command栏填入npm run build
Install Command栏填入npm install
然后, 点击底部的deploy按钮,等待部署完成。部署完成后,我得到网址:
https://nmb-kohl.vercel.app/
项目地址:
https://github.com/leerob/next-mdx-blog
https://github.com/briteming/nmb/
演示博客地址:
https://nmb-kohl.vercel.app/
https://nmb-kohl.vercel.app/n/fh 能显示视频。
No comments:
Post a Comment