A lightning-fast static site generator that combines the power of Markdown content with SvelteKit. Create beautiful static websites in minutes, with SvelteKit integration.
First, you need to create a SvelteKit project:
npx sv create .
npm install
Add Statue SSG to your SvelteKit project:
npm install statue-ssg
After installation, the setup process will automatically run. If it doesn't, you can manually run:
npx statue init
This will:
Start the development server:
npm run dev -- --open
That's it! You now have a fully functional static site generator with your SvelteKit project.
Add your Markdown content to the content
directory:
content/
βββ blog/ # Blog posts
β βββ post1.md # Example: /blog/post1
βββ docs/ # Documentation
β βββ guide.md # Example: /docs/guide
βββ static/ # Static pages
βββ about.md # Example: /static/about
Create Markdown files with frontmatter metadata:
---
title: My First Post
description: This is my first blog post
date: 2025-04-03
---
# Hello World
This is my first post using Statue SSG.
## Features
- Simple Markdown content
- Automatic routing
- Beautiful UI
If you encounter any issues during installation:
--ignore-scripts
setting is not enabled in your NPM configurationDuring the setup and build processes, the following occurs:
Project Setup:
The SvelteKit project is initialized using npx sv create
followed by installing dependencies.
Library Installation:
Running npm install statue-ssg
integrates the Statue SSG library into your project.
Initialization:
Executing npx statue init
triggers a post-install script. This script copies the template folder from within the library to your project, and updates configuration files (e.g., svelte.config.js
and others) accordingly.
Content Management:
Once set up, you can rapidly create a site by editing the Markdown files in the content
folder. Group your content by simply creating new folders and adding Markdown files to them. If you want to modify the homepage, edit the page.svelte
file under the routes
folder. Additionally, you can extend your site by creating your own Svelte files within the routes
folder.
Static Site Generation:
When you run npm run build
, the build process executes hooks/server.js
. This file uses an entries
method to scan all your projectβs root routes and converts them into static pages.
The rest of the rendering process relies on SvelteKitβs default behavior, where +page.svelte
and +page.server.js
files are rendered.
Preview:
Finally, use npm run preview
to view the generated static site.
These additional notes provide insight into the inner workings of Statue SSG, helping you understand and troubleshoot the setup and build processes when needed.
If you want to update the project:
package.json
.npm run release
to release the update.If you want to test your changes locally before publishing:
npm pack
to compile your project into a local package.npm install <path-to-compiled-folder>
to install and test the compiled version locally.
This allows you to verify all your changes in a local environment.MIT