commit 20b742770739f811c9c614b54f1f5526f76ef30d
parent b3ff6eb8de7f9dab9bf485e17cc08c7da411ca31
Author: Henry Unite <unitehenry@gmail.com>
Date: Wed, 8 Apr 2026 04:29:41 +0000
feat: init main
Diffstat:
3 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1 @@
+site
diff --git a/scripts/generate b/scripts/generate
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+gcc src/main.c -o site
+
+chmod +x site
+
+./site content
diff --git a/src/main.c b/src/main.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <dirent.h>
+
+/*
+ * - For each markdown file in `content` (command line arg)
+ * - Generate html with `pandoc`
+ * - Load `templates/base.html` (from command line arg)
+ * - For each `content` html, replace sections
+ * - Generate output html file equivalent
+ */
+int main(int argc, char **args) {
+ printf("hello world: %d\n", argc);
+
+ if (argc < 2) {
+ fprintf(stderr, "Must provide content directory\n");
+
+ return 1;
+ }
+
+ DIR *dr = opendir("content");
+
+ struct dirent *de;
+
+ while((de = readdir(dr)) != NULL) {
+ printf("%s\n", de->d_name);
+ }
+
+ closedir(dr);
+
+ return 0;
+}