(Work in progress) Static website generator.
- PHP 99.9%
| src | ||
| tests | ||
| .gitignore | ||
| composer.json | ||
| composer.lock | ||
| generate-site | ||
| LICENSE | ||
| phpstan.neon | ||
| phpunit.xml | ||
| README.md | ||
| slendium-static.php | ||
Slendium Static
Static website generator.
Installation
Requires PHP >= 8.5, Composer and npm. Simply
run composer install slendium/slendium-static to add it to your project.
Usage
Create a content/ directory and a slendium-static.php configuration file in the root of your project.
Each file in the content/ directory corresponds to a page of the generated site. Pages can be created
using either HTML or Markdown. Running the script at vendor/bin/generate-site will generate the site
in the public/ directory.
Examples
Default configuration file
The configuration file lives at slendium-static.php in the root directory of your project. It should
return an ArrayAccess|array where each key is a configuration name. Use the ConfigsBuilder for
type-safe configuration, as in the example below.
return new ConfigsBuilder()
->setTitleTemplate(static fn($localTitle) => "$localTitle - My Website")
->setBaseSectionProvider(new ArraySectionProvider([
SectionNames::HEADER => new HtmlSection('Enter your header-HTML here'),
SectionNames::FOOTER => new HtmlSection('Enter your footer-HTML here'),
]))
->build();
Roadmap
- [Done] Static pages based on HTML or Markdown only
- [Done] Include a global stylesheet
- Integrate compositor library
- Support for multi-locale sites
- Page generation (for pagination of blogs, product pages, or similar)
- Integrate JS/CSS minification strategies
- Auto-optimized images with support for cropping based on screen size
- Validating site integrity by checking all internal links