Total Pageviews

Wednesday, 1 January 2025

搭建静态博客程序urara

 需在非windows系统上搭建。在windows系统上搭建,会失败。

登录linux vps.安装nodejs环境和pnpm.

然后,

git clone https://github.com/importantimport/urara

cd urara

pnpm install

pnpm dev

pnpm build (此命令即生成/更新静态网站的根目录的命令,它会在当前目录下,生成build目录)


root@racknerd-626f077:~/urara# ls
build             node_modules    svelte.config.js    urara.js
COPYING           package.json    tailwind.config.ts  urara.ts
degit.json        pnpm-lock.yaml  tsconfig.json       vite.config.ts
eslint.config.ts  README.md       tsconfig.node.json
mdsvex.config.js  README.zh.md    uno.config.ts
netlify.toml      src             urara
root@racknerd-626f077:~/urara# cd build
root@racknerd-626f077:~/urara/build# ls
_app      favicon.png  manifest.webmanifest  sw.js               
assets    feed.json                       tags.json
atom.xml  hello-world  posts.json           
index.html   sitemap.xml           workbox-f3e6b16a.js
root@racknerd-626f077:~/urara/build#

(可见~/urara/build目录就是静态网站的根目录)

新建源帖:

root@racknerd-626f077:~/urara/build# cd ..

root@racknerd-626f077:~/urara# cd urara
root@racknerd-626f077:~/urara/urara# ls
assets  favicon.png  hello-world 
root@racknerd-626f077:~/urara/urara# mkdir test

root@racknerd-626f077:~/urara/urara# cp hello-world/+page.svelte.md test/

root@racknerd-626f077:~/urara/urara# cd test
root@racknerd-626f077:~/urara/urara/test# ls
+page.svelte.md
root@racknerd-626f077:~/urara/urara/test# nano +page.svelte.md

root@racknerd-626f077:~/urara/urara/test# cat +page.svelte.md
---
title: '测试'
alt: 'Urara'
created: 2025-01-01 00:19:00
updated: 2025-01-01 00:19:00
tags:
  - 'misc1'
  - 'misc2'
---

这是测试。

看看如何?

root@racknerd-626f077:~/urara/urara/test# cd ../..

root@racknerd-626f077:~/urara# pnpm build

root@racknerd-626f077:~/urara# cd build
root@racknerd-626f077:~/urara/build#

root@racknerd-626f077:~/urara/build# netlify deploy

root@racknerd-626f077:~/urara/build# netlify deploy --prod

演示网站:https://urr.netlify.app/

项目地址:https://github.com/importantimport/urara

https://github.com/importantimport/urara/issues/86

之前写的“搭建静态博客程序 svelte-QWER”(https://briteming.blogspot.com/2024/12/svelte-qwer.html)其实是源自这个项目:

https://github.com/importantimport/urara ,但做了改进,项目https://github.com/kwchang0831/svelte-QWER不仅可以搭建在linux空间上(搭建在linux空间上肯定是没问题的。),还可以搭建在windows机器上。此文https://briteming.blogspot.com/2024/12/svelte-qwer.html的操作就是在本地的windows机器上进行的。

相关帖子:

https://briteming.blogspot.com/2024/12/svelte-qwer.html



No comments:

Post a Comment