← UI Rendering & SSR

UI RENDERING & SSR FEATURE

Asset Pipeline

Declare assets with glob patterns in assets.json — served, versioned, and injected automatically.

Feature Guide

A quick orientation block that answers the essential questions: what this feature does, how it works, why it matters, and the key concepts behind it.

What this does

Declare assets with glob patterns in assets.json — served, versioned, and injected automatically.

Asset Manifest

9 assets wired automatically

The framework resolves manifest globs, versions files, and injects them into the correct head or body slot.

{
  "$schema": "semitexa://asset-manifest/v2",
  "include": [
    { "glob": "css/**/*.css", "inject": "head" },
    { "glob": "js/**/*.js",   "inject": "body" }
  ]
}
File Inject point Purpose
css/demo.css head Core layout, typography, cards
css/disclosure.css head Expandable sections, drawers, tooltips
css/feature-explorer.css head Three-panel grid layout
css/code-highlight.css head Code block tabs and syntax
js/demo-app.js body Visited tracking, feature tree
js/disclosure.js body Expand/collapse, drawer, tooltip
js/code-tabs.js body Tab switching, clipboard copy
js/live-result.js body Interactive HTTP client panel
js/sse-demo.js body SSE connect/disconnect UI
assets.json asset_head() asset_body() glob patterns versioning

Verified against Semitexa Ultimate 2026.09.19.1020

Asset Pipeline

The asset pipeline expands manifest globs, versions files, and injects them into head or body automatically. Declare assets with glob patterns in assets.json and the framework handles the rest.

How it works

Each module ships an assets.json manifest that declares which files to include and where to inject them. The framework resolves glob patterns, generates versioned URLs, and injects the results into the correct document position.

{
  "$schema": "semitexa://asset-manifest/v2",
  "include": [
    { "glob": "css/**/*.css", "inject": "head" },
    { "glob": "js/**/*.js",   "inject": "body" }
  ]
}

Key mechanisms

  • assets.json — the manifest file declaring which files to collect and where to inject them.
  • asset_head() — Twig function that outputs all assets registered for the head position.
  • asset_body() — Twig function that outputs all assets registered for the body position.
  • Glob patterns — patterns like css/**/*.css expand to all matching files at build or boot time.
  • Versioning — file content hashes or timestamps are appended to asset URLs for cache-busting.

Why this matters

Manual <link> and <script> tags in templates drift out of sync with the actual files. Glob-based manifests remove the per-file registration step and keep injection positions consistent across modules.

© Linus Torvalds: "Talk is cheap. Show me the code."

assets.json Implementation slice
// assets.json not found

Support Semitexa
Built for developers who prefer control over magic. Your support helps keep it fast, open, and evolving.

Donate via PayPal