PHPackages                             webgen/webgen - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. webgen/webgen

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webgen/webgen
=============

Static site generator written in PHP.

21[1 issues](https://github.com/webgen-org/webgen/issues)HTML

Since Dec 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/webgen-org/webgen)[ Packagist](https://packagist.org/packages/webgen/webgen)[ RSS](/packages/webgen-webgen/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Webgen
======

[](#webgen)

[![Build Status](https://camo.githubusercontent.com/5f7d31398f32d300483da53d498e7d179bd242d13f5cb07bfa29f602fbafda67/68747470733a2f2f7472617669732d63692e6f72672f77656267656e2d6f72672f77656267656e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webgen-org/webgen)

Simple PHP CLI generator of static web sites.

[![Become a Patron!](https://camo.githubusercontent.com/ef7b855018f1f680eeba6fd1ac470b9c1971ef883b2f4b9fcf41034274510e3f/68747470733a2f2f63352e70617472656f6e2e636f6d2f65787465726e616c2f6c6f676f2f6265636f6d655f615f706174726f6e5f627574746f6e2e706e67)](https://www.patreon.com/bePatron?u=9680759)[![Buy me a coffee](https://camo.githubusercontent.com/6016f6f11f8d00a9d3cccff14441a50c0326363529ee3b7f22a4615a34745ff7/68747470733a2f2f6275796d65636f666665652e696e746d2e6f72672f696d672f627574746f6e2d70617970616c2d77686974652e706e67)](https://www.paypal.me/janpecha/5eur)

Features
--------

[](#features)

- [Texy!](https://texy.info/) support
- [Latte templates](https://latte.nette.org/) support

Usage
-----

[](#usage)

```
$ cd examples/basic
$ php -f ../../webgen.php -- --run
$ cd output
$ ls
articles  index.html

```

---

***Note:*** *Webgen ignores files with `@` on start of filename.*

Templating
----------

[](#templating)

**Texy in Latte template**

```
{block |texy}
This is **Texy** snippet.
{/block}

{texy}
This is "Texy":https://texy.info snippet too.
{/texy}
```

**Get name of current generated file**

```
{$webgen->currentFile} {* prints for example: 'articles/article-2.texy' *}
```

**Get relative path from `currentFile` to a file**

```
{$webgen->createRelativeLink('articles/article-1.html')}
{* prints:
'article-1.html'          for currentFile = 'articles/article-2.texy'
'articles/article-1.html' for currentFile = 'index.texy'
*}
```

Shortcuts (output for `currentFile = 'articles/article-2.texy'`)

```
{link articles/article-1.html} {* prints article-1.html *}

Article #1
{* prints *}
Article #1

{* prints *}

{* prints *}

{* prints (image file must exist) *}

```

Relative paths in Texy:

```
"Article #1":@articles/article-1.html

[* @images/photo.jpg *]

```

**Highlight current page in menu** *(is link current?)*

```

    Homepage
    About us
    Contact

```

In mask `**` means *everything*, `*` means *everything **except** `/`*.

**Variables in Texy document**

```
{{$var}}

{{$var = value}}

{{$var: value}}

```

Configuration
-------------

[](#configuration)

Configuration is stored in file named [`config.neon`](examples/basic/config.neon). [NEON](https://ne-on.org/) is format very similar to YAML, see .

**Change name of source or output directory**

```
input:
	dir:

output:
	dir:

```

**Change name of layout template**

```
input:
	layout: @my-layout-name.latte

```

**Copy files from source directory into output directory (CSS &amp; JS files, images,...)**

Boolean value (`yes`/`no`) or filemask(s):

```
input:
    copy: yes

```

```
input:
    copy:
        - *.js
        - *.css

```

**Change default output file extension**

```
output:
    ext: php

```

File-specific change:

```
{webgen ext => php}   ## in Latte template
{{webgen: ext: php}}  ## in Texy file
```

**Change output filename**

```
## changes output file extension
{webgen ext => php}

## changes output basename of file
{webgen name => my-first-page}

## changes output filename (ignores 'ext' option)
{webgen filename => my-first-page.html}
```

Pagination
----------

[](#pagination)

See example [pagination-repeated-generating](examples/pagination-repeated-generating).

Who uses Webgen?
----------------

[](#who-uses-webgen)

-
-
-

Articles:

-  (in Czech)
-  (in Czech)

---

License: [New BSD License](license.txt)
Author: Jan Pecha,

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c980b1511b4a0350442dc23d89c99d4d9a2411b7e765d52c133ccacf616968b?d=identicon)[janpecha](/maintainers/janpecha)

---

Top Contributors

[![janpecha](https://avatars.githubusercontent.com/u/637719?v=4)](https://github.com/janpecha "janpecha (151 commits)")

---

Tags

phpstatic-site-generatortexywebgen

### Embed Badge

![Health badge](/badges/webgen-webgen/health.svg)

```
[![Health](https://phpackages.com/badges/webgen-webgen/health.svg)](https://phpackages.com/packages/webgen-webgen)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
