# Jelly CMS A fast, lightweight static site generator written in C that supports multilingual content, template partials, and asset management. ## Features - [x] Multilingual Support**: Automatic locale detection and site generation - [x] Template Partials**: Reusable HTML components with includes - [x] Zero Dependencies**: Single executable with no external requirements - [ ] CGI support - [ ] Help command that shows readme ## Quick Start ### Installation 1. Clone or download the project files (`main.c` and `Makefile`) 2. Build the executable: ```bash make ``` ### Project Structure ``` your-project/ ├── assets/ # Static assets (images, fonts, etc.) │ └── images/ │ └── logo.png ├── locale/ # Locale files (optional) │ ├── en.json │ ├── ru.json │ └── kk.json ├── public/ # Public files copied as-is │ ├── robots.txt │ ├── sitemap.xml │ └── main.css ├── src/ │ ├── pages/ # Your HTML pages │ │ ├── index.html │ │ └── about/ │ │ └── contacts.html │ └── partials/ # Reusable components │ ├── header.html │ └── footer.html ├── vendor/ # Third-party libraries │ └── alpinejs.min.js └── jelly-cms # The built executable ``` ### Build Your Site ```bash ./jelly-cms build ``` This creates a `build/` directory with your generated site. ## Templating ### Including Partials Use the include syntax to embed reusable components: ```html
Contact us: %locale.phone%
%locale.address% ``` ## Localization ### Setting Up Locales 1. Create a `locale/` directory 2. Add JSON files for each language (e.g., `en.json`, `ru.json`, `kk.json`) **Example `locale/en.json`:** ```json { "welcome_title": "Welcome to Our Website", "phone": "+1 555 123 4567", "address": "123 Main St, City, Country", "nav_home": "Home", "nav_about": "About", "footer_copyright": "© 2024 My Company" } ``` **Example `locale/ru.json`:** ```json { "welcome_title": "Добро пожаловать на наш сайт", "phone": "+7 123 456 7890", "address": "ул. Главная 123, Город, Страна", "nav_home": "Главная", "nav_about": "О нас", "footer_copyright": "© 2024 Моя Компания" } ``` ### Build Output With locales, Jelly CMS generates: ``` build/ ├── en/ │ ├── index.html │ └── about/ │ └── contacts.html ├── ru/ │ ├── index.html │ └── about/ │ └── contacts.html ├── assets/ │ └── images/ │ └── logo.png ├── vendor/ │ └── alpinejs.min.js ├── robots.txt ├── sitemap.xml └── main.css ``` Without locales: ``` build/ ├── index.html ├── about/ │ └── contacts.html ├── assets/ ├── vendor/ ├── robots.txt ├── sitemap.xml └── main.css ``` ## Directory Behavior | Source Directory | Build Behavior | |-----------------|----------------| | `assets/` | Copied to `build/assets/` | | `public/` | Contents copied directly to `build/` root | | `vendor/` | Copied to `build/vendor/` | | `src/pages/` | Processed as templates, structure preserved | | `src/partials/` | Used for includes, not copied to build | | `locale/` | Used for templating, not copied to build | ## Example Templates ### Main Page (`src/pages/index.html`) ```html%locale.welcome_message%