English · Русский
A static wiki for a personal fact site: articles are written in the admin panel and then built into standalone HTML files to be served with no PHP in production.
The project is a fork of LibArea/Sugata, reworked around an encyclopedia model: version history, auto-links between articles, backlinks and broken-link checking.
- Static build of every article as
{category}/{slug}.html, categories asindex.html/page-N.html, plussitemap.xmland a sharedfooter.shtml. - Incremental rebuild — only changed facts and the categories/home that depend on them are updated.
- Version history — a snapshot of the state before each edit (content, slug, metadata); view any version and roll back to it.
- Auto-links
[[Term]]— wiki markup resolved to a blue link on an unambiguous match, or to a red "create" link when the article does not exist (in the admin/preview). - Backlinks “What links here” — a list of articles that link to the current one.
- Broken-link checking — a report of broken
[text](/url)and uncreated[[Term]]links. - Search with Russian/English morphology (S2\Rose, Porter stemmer).
- CommonMark markup (+ GFM extensions: tables, footnotes, task lists, strikethrough) with dangerous HTML escaped.
- Plugin system — a hook system: plugins register PRE/POST hooks in their folder and extend pages without touching the core.
- PHP 8.2+
- MySQL 8 / MariaDB 10.2.2+
- Framework HLEB (2.x)
- Parser league/commonmark (CommonMark/GFM)
- Search S2\Rose
config/ settings (general, database, main, meta...)
routes/map.php routes (admin panel + preview)
app/
Controllers/ controllers (build, articles, history, rollbacks...)
Models/ DB layer (ItemModel, VersionModel, BacklinkModel...)
Content/ Parser (CommonMark + wiki links), Html, Meta, Img, Validator
helpers.php global functions
resources/views/ templates (admin, front-end, shared components)
public/ entry point, assets (built into static output)
scripts/dev.sql DB schema and test data
wiki-view.local/ BUILD OUTPUT (static site)
composer install- Create a database and import the schema:
scripts/dev.sql(includes the structure and test data). - Set the connection in
config/database.php(orconfig/database-local.php). - Configure
config/general.php:url(admin),url_html(public static address),path_html(build folder). - Point a web server at the
public/folder.
- Administrator:
ss@sdf.ru/qwer14qwer14 - User:
test@test.ru/test@test.ru
Admin panel: https://<url>/mod/admin/
In the admin panel (menu Tools) run in order:
- Rebuild assets — build CSS/JS (Minify) from sources.
- Category paths — recalculate
facet_path. - Create directories — category folders.
- Build category HTML pages —
index.html/page-N.htmlfor each category. - Build fact HTML pages — each article into its own
.html. - Update search index — rebuild the morphological index.
- Sitemap — generate
sitemap.xml. - Check sources/broken links — HEAD checks on sources and a scan for broken/uncreated links.
Incremental build — rebuilds only the changed facts and dependent categories/home; useful after edits when a full rebuild is not needed.
Both linking styles are supported inside articles:
| Syntax | Result |
|---|---|
[[Dzogchen]] |
Auto-link. Unambiguous match → blue; none/ambiguous → red (in the admin) |
[[Text|Dzogchen]] |
Same, but with arbitrary link text |
[[Text|/path/slug.html]] |
Explicit exact link to a specific URL |
[text](/path/slug.html) |
A regular markdown link (not checked by the engine) |
:::{.foto} … ::: |
Block container with a class (photo with caption, notes) |
[^1] and [^1]: text |
Footnotes (gathered into a “Notes” block) |
Red and broken links are gathered in the Broken links report (/mod/admin/broken-links).
Pages expose extension points (hooks) that plugins can subscribe to without modifying the core. Each plugin lives in its own folder under app/Plugins/, so installing one is just copying the folder — no central registry to edit:
app/Plugins/
Demo/
Demo.php # the plugin class (namespace App\Plugins\Demo)
manifest.php # metadata + hook points
manifest.php declares the plugin's hooks:
return [
'name' => 'Demo',
'version' => '0.1',
'description' => '...',
'hooks' => [
// [hook point, 'PRE'|'POST', 'Class::method', enabled]
['site_page_footer', 'POST', 'Demo::render_menu', 1],
],
];PREhooks run before the default code and may replace its result (returnnullto continue).POSThooks receive the default result and may alter it.- Plugins are toggled on/off in the admin panel (
/mod/admin/plugins); the enabled state is kept separately (instorage/cache) and never modifies the plugin folder itself.
Available hook points: site_article_before, site_article_body, site_article_related_before, site_article_backlinks, site_article_ldjson, site_page_footer. New points are added by calling dispatch('point_name', $default, $args) in a template.
items— facts/articles/pages.facets,facets_items_relation— the category tree and the article↔category relation.item_history— version history (a snapshot before each edit; rollbacks and viewing).item_relations— manual “related articles” links (both directions).sources,article_sources— fact sources and their bindings.broken_links— the broken/uncreated-link report.item_faq— “question–answer” blocks.users— users and permissions.
MIT. See LICENSE.

