(S)ophie's (S)tatic (S)ite (G)enerator
Find a file
yourfriendoss e183025a16
All checks were successful
/ build (node-16) (push) Successful in 19s
/ build (windows-node-iron) (push) Successful in 1m14s
buncha stuff
2025-12-12 18:36:31 +02:00
.forgejo/workflows fix workflow 2025-10-20 01:25:01 +03:00
src buncha stuff 2025-12-12 18:36:31 +02:00
.gitignore first commit 2024-08-02 04:25:05 +03:00
bun.lockb format everything + support windows now 2025-10-19 02:22:26 +03:00
metadata.md Beautiful 2025-11-17 15:54:45 +02:00
package.json Beautiful 2025-11-17 15:54:45 +02:00
README.md Beautiful 2025-11-17 15:54:45 +02:00
tsconfig.json first commit 2024-08-02 04:25:05 +03:00

(S)ophie's (S)tatic (S)ite (G)enerator

Sophie's Static Site Generator (aka. SSSG) is a infnintely expandable SSG based on plugins. It ships with some plugins already included, such as:

  1. A compile time JS runner sssg/src/plugins/compile-time-js
    Example: {& 1+3 &} will give you 4 in the generated code
  2. Development plugin sssg/src/plugins/dev
    Creates a websocket server for instant updates and a HTTP server for serving up data at (by default) localhost:8080.
  3. Image optimizations sssg/src/plugins/image-optimization
    Optimizes all of your images sometimes losslessly. Uses the sharp NPM module to re-encode all image files.
  4. Markdown compiler sssg/src/plugins/markdown-compiler
    Compiles all .md files into .html files, while taking out the metadata.
  5. Markdown metadata extractor sssg/src/plugins/markdown-metadata
    Extracts metadata into a .json file with the same name as the .MD file. Metadata format follows this format.
  6. PostCSS sssg/src/plugins/postcss
    PostCSS plugin, allows you to use PostCSS in your app.
  7. Typescript compiler sssg/src/plugins/postcss
    Allows you to compile typescript into .js files. Supports TSX with Preact.
  8. Variables ssg/src/plugins/variables
    Define variables in the build script to later use in the code. __SOME_VARIABLE__.

You can easily create more plugins.

All plugins are tested induvidually and in different ways. You can run all of the tests with bun test, however every commit they're already tested on both Windows and Linux.

Usage

bun add sssg

Example

import SSSG from "sssg";
import Dev from "sssg/src/plugins/dev";
import TSCompiler from "sssg/src/plugins/ts-compiler";

import * as path from "path";

const sssg = new SSSG({
  outputFolder: path.join(__dirname, "dist"),
  inputFolder: path.join(__dirname, "website"),
});

await sssg.run({
  plugins: [
    new TSCompiler(),
    new Dev(sssg),
  ],
});

await sssg.build();

design goals:

  1. rewrite and generate custom HTML/TS/JS/whatever..
  2. allow for variables and other important features in buildsystem->html
  3. plugins, this ties together the top two
  4. HMR and HTML/CSS reloading (in the Dev plugin)
  5. Rewriteable file renaming
  6. Every plugin runs on the same set of files, and can rename and reinject multiple times