Download the PHP package clarkwinkelmann/flarum-pages-generator without Composer
On this page you can find all versions of the php package clarkwinkelmann/flarum-pages-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download clarkwinkelmann/flarum-pages-generator
More information about clarkwinkelmann/flarum-pages-generator
Files in clarkwinkelmann/flarum-pages-generator
Package flarum-pages-generator
Short Description Generate pseudo-static pages from markdown and HTML files for Flarum
License MIT
Informations about the package flarum-pages-generator
Flarum Pages Generator
This is not a Flarum extension.
This package provides a Flarum extender that you can use in the local extend.php
to define custom pages.
Install at the root of your Flarum, or as a dependency to one of your custom extensions.
I don't recommend bundling this as a dependency of public extensions.
This package is in beta! Breaking releases will be released regularly. Make sure to use ^
or ~
semver constraints!
composer require clarkwinkelmann/flarum-pages-generator
Usage
In extend.php
:
->source(string $path)
defines a source folder to enumerate for pages.
->mithrilComponent(string $tag, string $import)
optionally defines a mapping of an HTML tag to a Mithril component.
The expression will be called with eval()
.
You can call source
and mithrilComponent
multiple times on a single extender instance.
At the moment, a single extender instance must exist in the Flarum application! If multiple extensions try to use it, it will break.
Pages
Pages can be Markdown (.md
) or HTML (.html
) and must include a Yaml front matter.
Markdown is parsed using the Flarum formatter. Any markdown or bbcode made available by extensions will be available.
The filename without file extension will be the page URL. Subfolders under the source directory are preserved as part of the URL.
Example: basic markdown
Example: basic HTML
Example: Markdown page with custom component