(Work in progress) Static website generator.
Find a file
C. Fahner c631a9c487 Front matter (#7)
Resolves #4 and #1.

Co-authored-by: C. Fahner <cfahner.git.ixuk9phi@slendium.org>
Reviewed-on: #7
2026-06-18 18:34:15 +02:00
src Front matter (#7) 2026-06-18 18:34:15 +02:00
tests Front matter (#7) 2026-06-18 18:34:15 +02:00
.gitignore Update .gitignore to include the input/output folders used to test 2026-03-07 13:06:25 +01:00
composer.json Front matter (#7) 2026-06-18 18:34:15 +02:00
composer.lock Front matter (#7) 2026-06-18 18:34:15 +02: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 Front matter (#7) 2026-06-18 18:34:15 +02: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 require 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

Markdown article

An article can be defined using markdown. Metadata can be declared using a YAML or JSON prefix.

---
title: Alternative title
description: A description or summary of the article.
created: 2026-06-18
draft: true
---

# Title

Lorem ipsum. This page is a draft so it won't be in the output.

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