From a5109e1b20e60d7d27e65adef0257832785502e6 Mon Sep 17 00:00:00 2001 From: yourfriendoss Date: Mon, 17 Nov 2025 15:54:45 +0200 Subject: [PATCH] Beautiful --- README.md | 28 +++++++++++++++++++++++++--- metadata.md | 34 ++++++++++++++++++++++++++++++++++ package.json | 25 ++++++++++++++++++++++++- 3 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 metadata.md diff --git a/README.md b/README.md index 30d8f31..f5e8e4f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,31 @@ # (S)ophie's (S)tatic (S)ite (G)enerator -## Usage -`bun add git+https://git.sad.ovh/sophie/sssg` +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](metadata.md). +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.](metadata.md) +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__`. -## example +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 ```ts import SSSG from "sssg"; import Dev from "sssg/src/plugins/dev"; diff --git a/metadata.md b/metadata.md new file mode 100644 index 0000000..feb4b0f --- /dev/null +++ b/metadata.md @@ -0,0 +1,34 @@ +# Metadata Format +This format stores metadata at the top of a file using `key=value` +pairs. + +## Structure + + key=value + key=value + key=value + ==== + (rest of the file) + +- Each line before the separator must be `key=value`. +- The separator is a line containing only `=` characters (like `===` + or `====`). +- Anything after the separator is regular file content. + +## Example + + title=My Song + artist=Pink Floyd + year=1973 + ==== + Lyrics go here... + +## Parsed Result + +``` json +{ + "title": "My Song", + "artist": "Pink Floyd", + "year": "1973" +} +``` diff --git a/package.json b/package.json index 3ebfc1f..ea8ead2 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,32 @@ "module": "index.ts", "type": "module", "main": "src/index.ts", + "version": "1.0.0", + "description": "A static site generator built with Bun, TypeScript, and Preact.", "devDependencies": { "@types/bun": "^1.1.8" }, + "keywords": [ + "static-site-generator", + "ssg", + "preact", + "typescript", + "bun", + "esbuild" + ], + "engines": { + "bun": ">=1.0.0" + }, + "author": "Sophie Drijj ", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://git.sad.ovh/sophie/sssg/sssg.git" + }, + "bugs": { + "url": "https://git.sad.ovh/sophie/sssg/issues" + }, + "homepage": "https://sad.ovh", "peerDependencies": { "typescript": "^5.0.0" }, @@ -19,4 +42,4 @@ "preact": "^10.23.2", "sharp": "^0.33.5" } -} \ No newline at end of file +}