Next Generation Static Blog Framework ,下一代静态博客框架(支持页面/配置热重载)
- English | 简体中文
- English Docs | 中文文档 | Docs for Beta
- Demo: with valaxy-theme-yun
Usage
Try it Online
Init Project Locally
Just run the following command to init your blog:
# pnpm (recommended)
pnpm create valaxy
# npm
# npm init valaxy
# yarn
# yarn create valaxy
For a example, you can see demo/yun folder.
Features
- ⚡️ Vue 3, Vite 4, pnpm, ESBuild - born with fastness
- 🔥 Hot Reload with Config & Markdown
- 🔧 Type Tooltip for all config by
valaxy.config.ts
- 🗒 Extended Markdown Frontmatter
- 🗂 File based routing via vite-plugin-pages
- 📦 Components auto importing via unplugin-vue-components
- 🖨 Static-site generation (SSG) via vite-ssg (SPA is OK!)
- 🕸 RSS & Sitemap
- 🎨 Free to use Tailwind CSS via UnoCSS
- 🌍 CSS i18n in One Page
- 🔍 Use icons from any icon sets with classes - Icônes
- 👔 Extended Theme with Layout system
- ⚙️ Unit Testing with Vitest
- ☁️ Deploy zero-config
- Netlify with
netlify.toml
- GitHub Pages with
.github/workflows/gh-pages.yml
GitHub Actions
- Netlify with
- ♻️ Use any vite plugins
- 📲 You can implement PWA by vite-plugin-pwa
- ...
Dev
Want to get involved in the development? Look here.
Want to create your theme? Check valaxy-theme-starter.
Thanks
💗 The implementation of Valaxy is based on or refer the following projects:
from https://github.com/YunYouJun/valaxy
(demo blog: https://big-cake-jpg.github.io/
its source code: https://github.com/Big-Cake-jpg/big-cake-jpg.github.io)
-------------------------------------------------
Valaxy —— 快到没边的全新静态博客程序
打开了 Valaxy 的文档开始一顿操作,设置好以后已经基本处于可以用在生产环境的情况了。
同时我也感受到了它超快的速度以及原生的页面热重载,便打算把它介绍给大家。
Vue 3, Vite 2, pnpm, ESBuild - born with fastness
项目地址:https://github.com/YunYouJun/valaxy
本地初始化
新建一个文件夹,然后在这个文件夹内打开终端,输入如下内容进行初始化:
npm init valaxy
# `pnpm create valaxy` is recommened by author
根据命令行提示即可完成项目初始化。默认使用 Yun 主题,也可以选择文档主题(theme-press)。
进入到生成的项目文件夹内,输入指令安装依赖并启动本地预览:
npm install (or yarn)
npm run dev (or yarn dev)
本地预览启动以后,可以访问 http://localhost:4859 查看效果。然后就可以修改 valaxy.config.ts 来自定义你的博客了。
自动构建
可以使用 GitHub Pages/Netlify/Vercel/Cloudflare Pages。
.github/workflows/gh-pages.yml 将会自动部署 GitHub Pages,其他请参考文档。
手动部署
输入如下指令生成静态文件,然后就可以把 dist 文件夹下的内容部署到自己的服务器上了:
npm run build
# npm run build:spa for SPA
注意事项
Valaxy 目前还处于早期开发阶段,Yun 主题的功能仅复刻了 Hexo 版本的主要功能,你可以通过反馈 Bug/捐助云游君来支持 Valaxy 的开发。
-------------------------------------
Starter template generator for valaxy.
npm init valaxy
or
yarn create valaxy
or
pnpm create valaxy
Use execa@5
for cjs.
from https://github.com/YunYouJun/valaxy/tree/main/packages/create-valaxy
------
我的实际使用情况:
$ cd ~
$ mkdir valaxy-site
$ cd valaxy-site
$ npm init valaxy
显示:
> vuepress-theme-meteorlxy@1.9.0 npx
> create-valaxy
🌌 Valaxy v0.20.0
√ Select a type: » Blog - For Most Users
√ Project name: ... valaxy-blog-of-brite (会在当前目录下,生成 valaxy-blog-of-brite目录)
📁 C:\Users\12799\valaxy-site\valaxy-blog-of-brite
Scaffolding project in valaxy-blog-of-brite ...
Done.
√ Install and start it now? ... yes
√ Choose the agent » npm
$ cd valaxy-blog-of-brite/
$ ls
Dockerfile locales/ package-lock.json site.config.ts vercel.json
README.md netlify.toml package.json styles/
components/ nginx.conf pages/ tsconfig.json
layouts/ node_modules/ public/ valaxy.config.ts
$ ls pages
404.md about/ archives/ categories/ links/ posts/ tags/
$ cd pages/posts
$ ls
hello-valaxy.md
$ nano hf.md
$ cat hf.md
显示:
---
title: 快乐的节日
date: 2022-04-01
updated: 2022-04-01
tags:
- music
- life
top: 1
---
此处写正文或html codes.
$ cd ~/valaxy-site/valaxy-blog-of-brite/
$ pnpm build (此即生成/更新静态网站的根目录的命令)
$ ls
Dockerfile layouts/ node_modules/ public/ valaxy.config.ts
README.md locales/ package-lock.json site.config.ts vercel.json
components/ netlify.toml package.json styles/
dist/ nginx.conf pages/ tsconfig.json (生成了dist目录)
$ cd dist
$ python3 -m http.server 1234
演示网站:https://charming-begonia-7f392a.netlify.app/
项目地址: https://github.com/YunYouJun/valaxy
----------
相关帖子:https://briteming.blogspot.com/2024/10/vite.html
No comments:
Post a Comment