Total Pageviews

Monday, 28 October 2024

搭建基于vite的静态博客程序 antfu.me

 cd ~
git clone https://github.com/antfu/antfu.me antfu.me-site
cd antfu.me-siteu.m
pnpm install (不要用npm install. 用npm install会遇到错误)
pnpm build (这就是生成/更新静态网站的根目录的命令。此命令会在当前目录下,生成dist目录)

新建源帖:
cd ~/antfu.me-site/pages/posts
nano happy-festival.md
cat happy-festival.md
显示:
---
title: 快乐的节日
date: 2024-10-28 08:45:00
lang: en
description: 这是一篇文章
---

此处写正文或html codes

cd ../..
pnpm build

演示网站:https://sparkling-pastelito-98a036.netlify.app/
项目地址:https://github.com/antfu/antfu.me

此帖子https://sparkling-pastelito-98a036.netlify.app/posts/yangzhou遇到了https://briteming.blogspot.com/2024/10/nextjstailwind-nextjs-starter-blog.html里面说的一样的问题。
------------

部署到render.com平台

pnpm install; pnpm build

publish directory 的值一定要写dist

 https://github.com/antfu/antfu.me

 https://github.com/brightmann/aam

 https://github.com/brightmann/aam/tree/main/pages/posts

 部署成功后,我得到的网址是 https://aam-6a7n.onrender.com/posts

 https://aam-6a7n.onrender.com/posts/fh 能显示视频

 

类似的例子:

 https://github.com/ProsperBao/baii.icu
https://github.com/brightmann/pbi

https://github.com/brightmann/pbi/tree/main/pages/posts
https://pbi-yk3d.onrender.com/posts/
https://pbi-yk3d.onrender.com/posts/fh 能显示视频
(https://pbi-chi.vercel.app/posts有问题)

 

 

  





No comments:

Post a Comment