PHPackages                             ordinalm/gyokuto - 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. ordinalm/gyokuto

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

ordinalm/gyokuto
================

A static site generator module, using PHP, Markdown, and Twig.

08PHPCI passing

Since Oct 17Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ordinalM/gyokuto)[ Packagist](https://packagist.org/packages/ordinalm/gyokuto)[ RSS](/packages/ordinalm-gyokuto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Gyokuto - a PHP static site generator
=====================================

[](#gyokuto---a-php-static-site-generator)

Overview
--------

[](#overview)

Gyokuto uses PHP and Twig to render local Markdown content to produce a static site. It can be used as is, or combined with other PHP modules.

Installation
------------

[](#installation)

### Composer (recommended)

[](#composer-recommended)

In your project, install the module with:

```
composer require ordinalm/gyokuto dev-master

```

Page rendering
--------------

[](#page-rendering)

Start a build with:

```
vendor/ordinalm/gyokuto/bin/build

```

By default, this will look for content in `./content` and output to `./www`, reading config from `./gyokuto.yml`.

Use `-o /path/to/config/YOUR_CONFIG_FILE.yml` to use a different config file on startup.

Use `-v1` for verbose output.

### Markdown page structure

[](#markdown-page-structure)

Gyokuto will process flat Markdown files without metadata with no problems, but you may wish to include metadata using the Multimarkdown page header system.

```
---
title: About this site
date: 2020-10-18 13:30
header: true
---
Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Curabitur
blandit tempus porttitor. Maecenas faucibus mollis interdum. Cras justo
odio, dapibus ac facilisis in, egestas eget quam.

```

Markdown headers are parsed as YAML data and are then available to Twig templates.

You may also include Twig code within page content - e.g.

```
---
foo: bar
---
The value of "foo" is "{{ current_page.meta.foo }}".

```

will render as

> The value of "foo" is "bar".

See below for the values that are automatically available to Twig.

#### Special metadata variables

[](#special-metadata-variables)

The following metadata variables have special meaning to Gyokuto.

- `draft` - if set to a value evaluating to `true`, this page will *not* be copied over or included in any page lists or indexes.
- `template` - this determines the template used to process this page. If not set, the value is `default.twig`.
- `path` - if set, the page will be output to this path relative to the root of the output directory. This can also change the file extension e.g. `path: "sitemap.xml"`
- `hidden` - if set to a value evaluating to `true`, the page will be created in output, but won't be included in the indexing process, so will not appear in either `index` or `pages` lists (see Twig variables, below).

### Build process

[](#build-process)

#### Compile phase

[](#compile-phase)

All files in the content directory are marked as either parsable (`.md` or `.markdown` extension) or to simply be copied.

All parseable files are parsed, their metadata included in the overall page list, and, if appropriate, the metadata used to construct indexes.

#### Build phase

[](#build-phase)

Non-parsable files are simply copied unchanged to the same filename in the output directory. These can be of any type - images, CSS, PHP code etc.

Markdown files are parsed with the following steps:

1. All Twig code in the page body is evaluated.
2. The page body is converted into HTML from Markdown.
3. The chosen Twig template for that page, as defined in the `template` metadata value, is run.

### Twig variables available during rendering

[](#twig-variables-available-during-rendering)

- `current_page` - the page being rendered now
    - `meta`
        - `title` - an unescaped string, taken either from the `title` Markdown header field or from the filename
        - `date` - a UNIX timestamp taken either from the `date` field in the Markdown header
        - any other variables set in the page's Markdown header
    - `path` - from site root, beginning with `/`
    - `content` - processed HTML from page Markdown body (not available within pages)
- `pages` - all pages in the build, keyed by path, in descending order of `date`, do not include `content`. Can be used to look up page metadata referred to in indexes.
    - `meta`
        - `title`
        - `date`
    - `path`
- `config`
    - all values declared in the config file

If any metadata fields have been specified for indexing using the `index` value in the config file, they will appear as:

- `index` - keyed by the meta variable being indexed, sorted by the value of that variable
    - key 1
        - path 1
        - path 2
        - ...
    - key 2
        - path 3
        - ... ...

The paths can be used to look up page metadata in the `pages` list.

#### Example: list of all pages by tag

[](#example-list-of-all-pages-by-tag)

In `gyokuto.yml`:

```
index: [ "tags" ]

```

In a page or template:

```
{% for tag, pagelist in index.tags %}
{{ tag|escape }}

{% for path in pagelist %}
{{ pages[path].meta.title|escape }}
{% endfor %}

{% endfor %}

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance60

Regular maintenance activity

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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/fd5208f7960a6d8155053b40cf66bd45bfb710dc45b4f325646cb0e39337b76f?d=identicon)[ordinalm](/maintainers/ordinalm)

---

Top Contributors

[![ordinalM](https://avatars.githubusercontent.com/u/10001510?v=4)](https://github.com/ordinalM "ordinalM (99 commits)")

### Embed Badge

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

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

PHPackages © 2026

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