ViteHTMLStarter

vite-starter-markup-template — Vite Starter Template

By Grinch3214

A Vite-based static markup starter template that replaces Gulp with Handlebars partials, SCSS, and an image optimization pipeline, suitable for landing pages and small multi-page sites.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

1 previews
Author preview
Author-provided preview

Preview provided in the project README.

One original preview is available. Open the full image to inspect the design.

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-02View source

What stands out

A quick read of the recorded project description.

01

Uses Handlebars for partials and per-page JSON data template reuse

02

SCSS with autoprefixer and mobile-first media query sorting

03

Automatically converts JPG/PNG/JPEG to WebP during development and optimizes PNG/JPEG/SVG during builds

04

Automatically discovers all HTML pages in the root directory and under pages/**

05

Built-in dark/light theme toggle with the choice persisted in localStorage

06

Provides three scripts: npm run dev, build, and preview

Template Details

This is a Vite starter template for static markup development, positioned as an alternative to Gulp for landing pages or small multi-page sites. The template uses Handlebars to provide component-style HTML partials (partials and per-page JSON data), employs SCSS for styling, and integrates autoprefixer with mobile-first media query sorting. For images, when the development server starts, it converts JPG/PNG/JPEG under src/img to WebP into src/img/webp/; during production builds, it optimizes PNG, JPEG, and SVG at quality 70 via vite-plugin-image-optimizer. Multi-page support is provided by fast-glob automatically discovering all .html files in the root directory and under pages/**. A built-in dark/light theme toggle persists the state in localStorage under the theme-color key and takes effect via the data-theme attribute on html combined with CSS custom properties in _vars.scss.

Before use, note: the template includes demo content and placeholder assets, and the README provides a cleanup checklist, including deleting demo/, public/vite.svg, sample files under src/img and src/fonts, trimming style.scss and main.js, and clearing src/data and src/partials. If the site is deployed under a subpath, you need to modify rootPath in vite.config.js. The code is released under the MIT license, allowing free use, modification, commercial use, and distribution, but third-party assets such as demo images, fonts, and icons must be checked separately under their respective licenses; external services like domains and hosting may incur additional charges.

ViteHTMLStarter

Is it right for your project?

Use Cases

  • Developing landing pages or small multi-page static sites
  • Static markup projects migrating from a Gulp workflow to Vite
  • Static pages requiring Handlebars partials and per-page independent JSON data
  • Sites that need automatic WebP generation during development and image compression during builds

Suitable For

  • Front-end developers familiar with HTML, SCSS, and a little JavaScript
  • Projects that need multi-page static output rather than a single-page application
  • Teams looking to replace a Gulp build process with Vite
  • Static sites that need a dark/light theme toggle

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    After cloning the repository, rename the folder and run npm install

  2. 2

    Use npm run dev for development, npm run build for builds, and npm run preview to preview the build output

  3. 3

    When deploying under a subpath, modify rootPath in vite.config.js

  4. 4

    Follow the README cleanup checklist to remove demo, sample images/fonts, extra pages, and placeholder data before starting development

  5. 5

    Third-party assets such as demo images and fonts must be checked under their respective licenses; do not rely solely on the code's MIT license

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope applies to that version's code and does not imply that external services or third-party assets are free.

Must comply with when using

  • You are allowed to freely use, modify, commercially use, and distribute the code of this version.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • The template includes demo content and placeholder assets (demo/, public/vite.svg, sample files under src/img and src/fonts); these sample assets must be deleted according to the cleanup checklist before starting a real project.
  • If the site is deployed under a subpath, you must modify rootPath in vite.config.js, otherwise asset paths will break.
  • The cleanup checklist requires adjusting the LICENSE file for your own project, i.e., replacing or updating the copyright notice to match the actual project.
  • Demo images, fonts, icons, and other third-party assets must be checked under their respective licenses; do not rely solely on the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

Delete `public/vite.svg`, `demo/`, `src/img/**/*`, `src/fonts/**/*`

Original README

If your project is hosted at a sub-path, update `rootPath` in `vite.config.js`

Original README

Adapt `LICENSE`

Original README
https://github.com/Grinch3214/vite-starter-markup-template/blob/main/LICENSEhttps://github.com/Grinch3214/vite-starter-markup-template/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-02. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 80 / 100
Technologies
Vite · HTML
Website type
Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-06-06
Screenshot last checked
2026-10-02

No demo link is recorded. Use the repository instructions to evaluate the project locally; the screenshot alone cannot establish interactive behavior.

The catalog identifies Vite as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: b7c5fe816a298342248fdb9f0262b44f7eaa23c1dadb654ebbe9a31d0252dcac

2026-10-02T18:17:29.477Z

Source file / repository
# Vite Simple Starter Markup Template

![screenshot](/demo/main-page.png)

A simple, modern markup template built on Vite — designed as a comfortable replacement for Gulp when developing landing pages or small multi-page sites.

## Features

- **Build tool:** Vite v8
- **Templating:** Handlebars (partials + JSON data per page)
- **Styles:** SCSS with autoprefixer and media-query sorting
- **Images:** Auto WebP conversion, optimization for PNG/JPEG/SVG via Sharp & SVGO
- **Multi-page:** Auto-discovers all `.html` files in root and `pages/**`
- **Theme switcher:** Dark / Light mode with localStorage persistence

## Dependencies

| Package                                                                                | Purpose                                                      |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [vite](https://vitejs.dev/)                                                            | Build tool & dev server                                      |
| [vite-plugin-handlebars](https://github.com/alexlafroscia/vite-plugin-handlebars)      | Handlebars templating with partials and page-level JSON data |
| [sass](https://sass-lang.com/)                                                         | SCSS compilation                                             |
| [autoprefixer](https://www.npmjs.com/package/autoprefixer)                             | Vendor prefix injection                                      |
| [postcss-sort-media-queries](https://www.npmjs.com/package/postcss-sort-media-queries) | Sort & merge media queries (mobile-first)                    |
| [vite-plugin-image-optimizer](https://github.com/FatehAK/vite-plugin-image-optimizer)  | PNG / JPEG / SVG optimization on build                       |
| [sharp](https://sharp.pixelplumbing.com/)                                              | High-performance image processing backend                    |
| [svgo](https://github.com/svg/svgo)                                                    | SVG optimization                                             |
| [imagemin-webp](https://www.npmjs.com/package/imagemin-webp)                           | Converts PNG/JPG → WebP on dev server start                  |
| [fast-glob](https://github.com/mrmlnc/fast-glob)                                       | Multi-page HTML discovery                                    |

## Getting Started

1. Clone the repository:

```bash
git clone https://github.com/Grinch3214/vite-builder.git
```

2. Rename the folder, then install dependencies:

```bash
cd your-project-name
npm install
```

## Scripts

```bash
# Start the development server
npm run dev

# Build for production
npm run build

# Preview the production build
npm run preview
```

## Folder Structure

```plaintext
/
├── pages/                      # Additional HTML pages
│   └── sub-page/               # Supports nested page folders
├── public/                     # Static assets (copied as-is to dist)
├── src/
│   ├── data/                   # Per-page JSON context files for Handlebars
│   │   └── index.json          # Data for index.html
│   ├── fonts/                  # Web fonts (.woff2, etc.)
│   ├── img/                    # Source images
│   │   └── webp/               # Auto-generated WebP versions (dev server)
│   ├── js/                     # JavaScript modules
│   │   ├── main.js             # Entry point
│   │   └── theme.js            # Dark/Light theme switcher
│   ├── partials/               # Handlebars partial templates (.hbs)
│   └── scss/                   # SCSS styles
│       ├── style.scss          # Main entry (imports all partials)
│       ├── _reset.scss         # CSS reset
│       ├── _vars.scss          # CSS custom properties / variables
│       ├── _mixins.scss        # SCSS mixins
│       ├── _fonts.scss         # @font-face declarations
│       ├── _global.scss        # Global styles
│       └── _main.scss          # Page-specific styles
├── .gitignore
├── index.html                  # Root page entry point
├── LICENSE
├── package.json
├── postcss.config.cjs          # PostCSS configuration
├── vite.config.js              # Vite configuration
└── README.md
```

## Handlebars Templating

The template uses [vite-plugin-handlebars](https://github.com/alexlafroscia/vite-plugin-handlebars) for component-style HTML templating.

**Partials** live in `src/partials/` as `.hbs` files and are included via `{{> partialName}}`.

**Page data** lives in `src/data/` as JSON files. The file name must match the HTML page:

| HTML page          | Data file                   |
| ------------------ | --------------------------- |
| `index.html`       | `src/data/index.json`       |
| `pages/about.html` | `src/data/pages/about.json` |

Example usage in HTML:

```html
{{#each badges}} {{> badge}} {{/each}}
```

## Theme Switcher

A dark/light toggle is built in via `src/js/theme.js`. The selected theme is persisted in `localStorage` under the key `theme-color`. The `data-theme` attribute on `<html>` drives theming via CSS custom properties defined in `_vars.scss`.

## Image Optimization

- **Dev server:** On startup, all `src/img/**/*.{jpg,png,jpeg}` files are converted to WebP and placed in `src/img/webp/` automatically.
- **Production build:** PNG, JPEG, and SVG assets are optimized at quality 70 by `vite-plugin-image-optimizer`.

## Configuring the Base Path

If your project is hosted at a sub-path, update `rootPath` in `vite.config.js`:

```js
const rootPath = '/my-sub-path/';
```

## New Project Cleanup Checklist

After cloning, clean up the starter content:

- [ ] Remove `.git/` and run `git init`
- [ ] Update `README.md`
- [ ] Adapt `LICENSE`
- [ ] Delete `public/vite.svg`, `demo/`, `src/img/**/*`, `src/fonts/**/*`
- [ ] Remove extra `.html` files from `pages/`
- [ ] Clear `src/scss/style.scss` — keep only `@use` / `@forward` imports
- [ ] In `src/js/main.js` keep only `import '../scss/style.scss';`
- [ ] Clear `src/data/` and `src/partials/` — replace with your own

## License

Released under the [MIT License](LICENSE).

**Thank you and happy coding!** 💻
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.

react-starter-kit

react-starter-kit

A full-stack SaaS monorepo starter built on Vite and React, with Bun, TypeScript, tRPC, Drizzle ORM, Better Auth, Stripe, and Cloudflare Workers. It includes email OTP, passkey, Google OAuth, organizations, subscription billing, Drizzle migrations, seed scripts, and Terraform infrastructure.

Vite · SaaS

cove

cove

Cove is a minimal TanStack Start starter template maintained by mugnavo, integrating React, TanStack Router/Query, Tailwind CSS, shadcn/ui, Drizzle ORM with PostgreSQL, Better Auth, Vite Plus, and Nitro.

Vite · SaaS

vite-react-boilerplate

vite-react-boilerplate

A production-ready Vite + React starter template with TypeScript, Tailwind CSS, TanStack Router/Query/Table, Storybook, React Hook Form + Zod, Vitest and Playwright testing, plus Husky/Commitizen/Commitlint commit conventions.

Vite · Starter

react-vite-admin

react-vite-admin

A backend management starter built on Vite and React, integrating Recoil, React Query, TypeScript, and Axios, with Ant Design-style interface screenshots. Suitable as a starting point for management-side projects, licensed under MIT, with Chinese documentation and common scripts.

Vite · Admin dashboard

typescript-react_best_practices-vite_template

typescript-react_best_practices-vite_template

A Vite + React + TypeScript starter template by CodelyTV, preconfigured with Jest and React Testing Library unit tests, Cypress end-to-end tests, ESLint and Prettier using Codely's shared configuration, GitHub Actions workflows, a Makefile, and Sass.

Vite · Starter

cloudflare-starter-kit

cloudflare-starter-kit

A Cloudflare Workers project scaffolding template maintained by kriasoft, using Vite and TypeScript, with three built-in workspaces: api, app, and edge, and preconfigured local testing, multiple environments, and a GitHub Actions deployment workflow.

Vite · Starter