Labyricorn Static Site publishing Engine (labyricorn-engine)
Labyricorn is a Git-driven, fully deterministic static website generator and publishing engine. It uses a Gitea instance as the single source of truth, compiles content (Markdown files) and discussions (Gitea Issues/Comments), and serves them statically via Nginx.
No CMS database. No runtime backend engines. No Docker overhead. Built to run natively in lightweight Linux Containers (LXC).
---
๐ ๏ธ System Architecture
Gitea (git.labyricorn.com)
โ
Python Sync Engine (running via cron every 5 minutes)
โ
Static Filesystem Output (/var/www/labyricorn/)
โ
Nginx Web Server (serving static files with Clean URLs)
---
๐ Project Structure
/root/labyricorn/ # Main Git workspace
โโโ gitea_client.py # Gitea API authentication, repository scanner & archive downloader
โโโ metadata.py # Parser for repository-level .labyricorn/site.yml configurations
โโโ renderer.py # Markdown-to-HTML converter (includes TOC, code highlight, and asset mapping)
โโโ writer.py # Handles filesystem writes, media asset copies, and index.json cataloging
โโโ sync.py # Core orchestrator script
โโโ install.sh # Bash installer for system deployment
โโโ nginx-labyricorn.conf # Nginx server configuration (with clean URLs support)
โโโ setup_real_gitea.py # Script to populate Gitea with sample test content
โโโ .gitignore # Files excluded from Git tracking
โโโ templates/ # Jinja2 HTML layouts
โโโ base.html # Master layout with light/dark theme switch and radial glow styling
โโโ index.html # Homepage with hero banner, featured posts, and latest articles
โโโ list.html # Catalog listing with real-time text-filtering search in JS
โโโ article.html # Layout for articles (includes table of contents and comments timeline)
โโโ project.html # Layout for projects (includes repository stats for forks/stars/issues)
โโโ doc.html # Layout for documentation guides
---
๐ Installation & Deployment
Deploying the sync engine to your local LXC environment is simple:
- Clone or pull the repository into your local environment.
- Review your configuration or let the installer generate
/etc/labyricorn/sync.ymlwith your Gitea token. - Run the installer script:
sudo chmod +x install.sh
sudo ./install.sh
The script will:
- Copy files to their permanent runtime directory:
/opt/labyricorn/. - Create a configuration file at
/etc/labyricorn/sync.yml. - Set up a system cron job in
/etc/cron.d/labyricorn-syncto sync every 5 minutes. - Copy and activate the Nginx server configuration.
---
๐ How to Publish Content
To publish an article, project, or documentation guide from Gitea:
1. Create a Repository
Create a repository on Gitea (e.g. my-awesome-project).
2. Configure Site Settings
Create a configuration file in the repository at .labyricorn/site.yml:
enabled: true
type: project # content | project
visibility: featured # hidden | listed | featured
section: projects # articles | projects | docs
title: "My Awesome Project"
description: "A summary of what this project does."
tags:
- python
- automation
author: Admin
3. Add Markdown Content
Write your content in a README.md at the root of the repository. You can reference local images (e.g., images/diagram.png), which will be extracted and served automatically.
4. Discussions & Comments
Open issues inside the repository. The engine fetches issues and comments during sync runs and embeds them at the bottom of the page as a read-only discussion thread.
---
โ๏ธ Manual Synchronization
To trigger an immediate rebuild of the static site:
python3 /opt/labyricorn/sync.py --config /etc/labyricorn/sync.yml