ezar101 / litedocs
A lightweight static site generator.
Requires
- php: >=8.4
- league/commonmark: ^2.8
- symfony/console: ^7.0|^8.0
- symfony/event-dispatcher: ^7.0|^8.0
- symfony/filesystem: ^7.0|^8.0
- symfony/finder: ^7.0|^8.0
- symfony/options-resolver: ^7.0|^8.0
- symfony/yaml: ^7.0|^8.0
- twig/twig: ^3.22
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- friendsofphp/php-cs-fixer: ^3.91
- pestphp/pest: ^4.1
- phpstan/phpstan: ^2.1
README
LiteDocs
LiteDocs is a modern, lightweight, and blazing fast static site generator written in PHP 8.4+.
It is designed to build beautiful documentation sites from Markdown files with zero configuration.
π Read the Official Documentation
β¨ Features
- β‘ Zero Config: Works out of the box with sensible defaults.
- π¨ Theming: Powerful templating engine based on Twig. Includes a modern "Lite" theme.
- π Plugins: Extensible architecture using Symfony EventDispatcher.
- π Multilingual: Native support for internationalization (i18n).
- π Search: Built-in client-side search engine (no external services required).
- π Developer Friendly: 100% PHP, easy to override and extend.
π Installation
Option 1: Standalone PHAR (Recommended)
You can download the single executable file from the Releases Page.
wget https://github.com/Ezar101/LiteDocs/releases/latest/download/litedocs.phar chmod +x litedocs.phar sudo mv litedocs.phar /usr/local/bin/litedocs
Option 2: Via Composer
composer global require Ezar101/litedocs
π Quick Start
-
Initialize a new project Create a litedocs.yml file and a docs/ folder with some markdown files.
-
Build the site Run the build command in your project directory:
litedocs build
-
Development Mode (Optional) To automatically rebuild the site whenever you change a file:
litedocs watch
Tip: Open a second terminal and run
php -S localhost:8000 -t siteto view your changes live. -
Enjoy Your static site is generated in the site/ directory, ready to be deployed to GitHub Pages, Vercel, or Netlify.
βοΈ Configuration
Create a litedocs.yml file at the root of your project:
site_name: "My Awesome Docs" docs_dir: "docs" site_dir: "site" # Enable multilingual support languages: en: English fr: FranΓ§ais # Theme configuration theme: name: lite # Import navigation and plugins nav: "config/nav.yml" plugins: "config/plugins.yml"
π€ Contributing
Contributions are welcome! We enforce high code quality standards to keep the project maintainable.
Requirements
- PHP 8.4+
- Composer
Development Workflow
-
Fork the repository and create a new branch.
-
Install dependencies:
composer install
-
Write Tests: We use Pest PHP.
composer test -
Analyze Code: Ensure static analysis passes.
composer analyse
-
Fix Style: Format your code to PSR-12 standards.
composer lint # Check composer fix # Auto-fix
-
Submit a Pull Request.
Note: Our CI pipeline will automatically block any PR that does not pass tests or static analysis.
π License
LiteDocs is open-sourced software licensed under the MIT license.
