{"id":24725196,"url":"https://github.com/mujtaba-io/c-macro-static-site-generator","last_synced_at":"2025-03-22T13:45:32.555Z","repository":{"id":274195319,"uuid":"922195261","full_name":"mujtaba-io/c-macro-static-site-generator","owner":"mujtaba-io","description":"Static site generator, that uses C preprocessor syntax.","archived":false,"fork":false,"pushed_at":"2025-01-25T15:52:18.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T16:24:18.720Z","etag":null,"topics":["c-macros","c-preprocessor","static-site","static-site-generator","static-website","webdevelopment"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mujtaba-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-25T15:19:18.000Z","updated_at":"2025-01-25T16:03:06.000Z","dependencies_parsed_at":"2025-01-25T16:34:27.236Z","dependency_job_id":null,"html_url":"https://github.com/mujtaba-io/c-macro-static-site-generator","commit_stats":null,"previous_names":["mujtaba-io/c-macro-static-site-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujtaba-io%2Fc-macro-static-site-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujtaba-io%2Fc-macro-static-site-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujtaba-io%2Fc-macro-static-site-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujtaba-io%2Fc-macro-static-site-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mujtaba-io","download_url":"https://codeload.github.com/mujtaba-io/c-macro-static-site-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966461,"owners_count":20539794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-macros","c-preprocessor","static-site","static-site-generator","static-website","webdevelopment"],"created_at":"2025-01-27T13:17:24.047Z","updated_at":"2025-03-22T13:45:32.531Z","avatar_url":"https://github.com/mujtaba-io.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static Site Generator - C Preprocessor Syntax\n\nI made this as a quick solution to my unique problem. Although my problem could be solved easily using existing frameworks, but I wanted extremely fast solution requring no setup. So i made a C-macros syntax static site generator.\n\nI usaully make games on [game idea](https://gameidea.org), you can find my work there. Thank you for coming here!\n\n# Usage Examples\n\nIn a.html:\n```html\n#define header(title, subtitle) (\n    \u003cheader\u003e\n        \u003ch1\u003e{title}\u003c/h1\u003e\n        \u003ch2\u003e{subtitle}\u003c/h2\u003e\n    \u003c/header\u003e\n)\n```\n\nIn b.html:\n```html\n#include \u003c./a.html\u003e\n\nheader(My Hehe Title, My Good Subtitle)\n\n\n\u003c!-- defining more components --\u003e\n\n#define card(image, title, text) (\n    \u003cdiv class=\"card\"\u003e\n        \u003cimg src=\"{image}\" alt=\"{title}\"\u003e\n        \u003ch3\u003e{title}\u003c/h3\u003e\n        \u003cp\u003e{text}\u003c/p\u003e\n    \u003c/div\u003e\n)\n```\n\nAfter that, run `static_site_generator_machine.py` file. It will create a `build/` folder with a generated website. The other file,  `static_site_generator.py` is a layer on top of previous file, that automates the process of re-building as soon as changes have been made to the file. So if u need automated solution, just run the latter file and everything will be auto-generated on save, from the current directory.\n\n# Issues\n\n1. File paths are not resolved in generated site. So you have to put all your assets in `assets/` folder, otherwise issues may arise if during building, the contents of components are copied to other files present in another levels in system directory. Then references such as `./myimage.png` might introduce invalid path as now, the current directory is the directory of another component where this component is `#included`.\n2. I have not tested `#ifdef`, `#ifndef`, `#else`, `#endif`, `#undef` etc.\n\n# Other Examples\n\nWe declare a component using `#define` like this:\n![image](https://github.com/user-attachments/assets/82e1243c-443a-4c59-932f-c503ecef6896)\n\nIn the above code, the parameters values will be replaced with passed value.\n\n\nThen we use it like this:\n\n![image](https://github.com/user-attachments/assets/c031daae-0d16-4ffc-a2f6-dae038618d6b)\n\n\nThere is more we can do. Basically, most of C proprocessor is implemented, but there can be some issues in conditinoal thing such as `#ifndef`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujtaba-io%2Fc-macro-static-site-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmujtaba-io%2Fc-macro-static-site-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujtaba-io%2Fc-macro-static-site-generator/lists"}