Guide - Introduction

Dec 15, 2022 Β· 3min

logo

Vitesse ✘ QB Template

Building a static personal website template by Vite-SSG
Page data and page feature are made, implemented,and maintained by yourself
More control on the build process and tooling
Feel the lightweight, fast and free website building process

Tip: If you like out of the box declarative configuration build website, or dont know about page build development, you may be more suitable for Vitepress or other modern Static Site Generator

If you decide to use Vite-SSG to build personal website. Let’s explore together. The template extends the following feature and devDepends, which can be changed or deleted by yourself:

  • Basic style for website
  • Basic style for writing Markdown articles
  • Some Markdown enhanced syntax
  • Site common build scripts

Pre-packed

Scripts

json
{
  "scripts": {
    // development mode
    "dev": "vite --host",
    // build site
    "build": "vite-ssg build && pnpm build:post",
    // Generate RSS and sitemap concurrently after building the site
    "build:post": "run-p -c gen:rss gen:sitemap",
    // Preview the built site
    "serve": "vite preview --host",
    // Lint code
    "lint": "eslint .",
    // Fast commit cli: Define common message aliases(.czrc)
    // Usage e.g: pnpm cz :a
    "cz": "czg",
    // Generate posts RSS
    "gen:rss": "tsx ./build/node/rss.ts",
    // Generate sitemap
    "gen:sitemap": "tsx ./build/node/sitemap.ts"
  }
}
{
  "scripts": {
    // development mode
    "dev": "vite --host",
    // build site
    "build": "vite-ssg build && pnpm build:post",
    // Generate RSS and sitemap concurrently after building the site
    "build:post": "run-p -c gen:rss gen:sitemap",
    // Preview the built site
    "serve": "vite preview --host",
    // Lint code
    "lint": "eslint .",
    // Fast commit cli: Define common message aliases(.czrc)
    // Usage e.g: pnpm cz :a
    "cz": "czg",
    // Generate posts RSS
    "gen:rss": "tsx ./build/node/rss.ts",
    // Generate sitemap
    "gen:sitemap": "tsx ./build/node/sitemap.ts"
  }
}

Directory

sh
β”œβ”€β”€ build
β”‚  β”œβ”€β”€ markdown       Markdown-it plugin register and custom plugin
β”‚  └── node           scripts
β”œβ”€β”€ pages             site page content writing
β”‚  └── posts        * where you write articles
β”œβ”€β”€ public            static resources
└── src
   β”œβ”€β”€ components     page components
   β”œβ”€β”€ composables    public logic
   β”œβ”€β”€ layouts        page layouts
   β”œβ”€β”€ modules        global module
   β”œβ”€β”€ styles         page style
   └── utils          utiliy
β”œβ”€β”€ build
β”‚  β”œβ”€β”€ markdown       Markdown-it plugin register and custom plugin
β”‚  └── node           scripts
β”œβ”€β”€ pages             site page content writing
β”‚  └── posts        * where you write articles
β”œβ”€β”€ public            static resources
└── src
   β”œβ”€β”€ components     page components
   β”œβ”€β”€ composables    public logic
   β”œβ”€β”€ layouts        page layouts
   β”œβ”€β”€ modules        global module
   β”œβ”€β”€ styles         page style
   └── utils          utiliy

LICENSE

MIT Copyright 2023 Β© Q.Ben Zheng

Thanks and inspired by: