aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-08-01 12:20:00 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-08-01 12:20:00 +0530
commitad9a7a0a2929ca5a7dcf417859c06b055a8bc5a2 (patch)
tree84e16a875f6333a31e99bc22d0400245739c38bd
parentcc2426ef79ec722a43b7094f645e75d2b706c8a1 (diff)
README: add compilation, usage, site structure and features
-rw-r--r--README.md97
1 files changed, 96 insertions, 1 deletions
diff --git a/README.md b/README.md
index f04c8c6..04d8750 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,97 @@
# msg
-Minimal (Static) Site Generator
+An incredibly opinionated, hackable, minimal Static Site Generator.
+
+> See https://github.com/compromyse/compromyse.xyz for an example site.
+
+### Compilation & Usage
+```sh
+# REQUIREMENTS: CMake, Git, GCC/Clang, GNUMake/Ninja
+$ git clone https://github.com/compromyse/msg
+$ mkdir build && cd build
+$ cmake ..
+$ make # or ninja
+$ ./msg -h
+msg: The Minimal Static Site Generator
+
+Usage: ./msg [-h] [-w] [-v] [-o <output>] <directory>
+ -h : Help
+ -w : Watch working directory for changes
+ -v : Verbose
+ -o <output>: Output directory
+ <directory>: Working directory
+```
+
+### Site Structure
+```sh
+.
+├── assets
+│   └── me.webp
+├── config.cfg
+├── index.html
+├── partials
+│   ├── footer.html
+│   ├── navbar.html
+├── projects.html
+└── templates
+ └── base.html
+```
+
+### Features
+
+#### Includes - include files from `/partials`
+
+```html
+<!-- index.html -->
+<html>
+ <body>
+ {{ include "navbar.html" }}
+ ...
+ </body>
+</html>
+```
+
+#### Contentfor - define content for templates
+
+```html
+<!-- templates/base.html -->
+<html>
+ <head>
+ {{ content "head" }}
+ </head>
+ <body>
+ {{ body }}
+ </body>
+</html>
+
+<!-- index.html -->
+{{ contentfor "head" }}
+<title>HOME</title>
+{{ endcontent }}
+
+<p>...</p>
+```
+
+#### Eachdo - iterate over resources
+```html
+<!-- projects/xyz.html -->
+title = XYZ
+---
+
+<h1>XYZ!</h1>
+
+<!-- index.html -->
+{{ eachdo projects }}
+<p>{{ put title }}</p>
+{{ endeachdo }}
+```
+
+#### Template - specify template for page
+```html
+<!-- projects/xyz.html -->
+template = base_tailwind.html
+---
+
+<h1 class="p-2">XYZ!</h1>
+```
+
+`Licensed under GPLv3`