(Work in progress) Static website generator.
Find a file
2026-04-03 07:01:12 +02:00
src Rename DefaultStylesheet to CommonStyles and move both CommonStyles and Stylesheet into the Base\Site namespace 2026-04-03 07:01:12 +02:00
tests Large refactoring of Directory, File and Filesystem to use Path instances and separate source information from the conversion process 2026-04-02 16:31:21 +02:00
.gitignore Update .gitignore to include the input/output folders used to test 2026-03-07 13:06:25 +01:00
composer.json Update composer files 2026-03-13 05:38:07 +01:00
composer.lock Update composer files 2026-03-13 05:38:07 +01:00
generate-site Add generate-site binary command 2026-03-09 18:49:05 +01:00
LICENSE Initial commit 2026-02-05 19:04:41 +00:00
phpstan.neon Update phpstan.neon to always include the tests directory in its analysis' 2026-03-22 16:33:46 +01:00
phpunit.xml Add phpunit.xml 2026-02-15 15:35:45 +01:00
README.md Update README 2026-03-23 20:42:35 +01:00
slendium-static.php Add slendium-static.php as the default configuration for testing 2026-03-07 13:25:52 +01:00

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

  1. [Done] Static pages based on HTML or Markdown only
  2. [Done] Include a global stylesheet
  3. Integrate compositor library
  4. Support for multi-locale sites
  5. Page generation (for pagination of blogs, product pages, or similar)
  6. Integrate JS/CSS minification strategies
  7. Auto-optimized images with support for cropping based on screen size
  8. Validating site integrity by checking all internal links