asw-v01: archive deferred content (packs, site, lab, legacy examples)
- 2.1: packs/ -> archive/packs/ - 2.2: site/ -> archive/site/ - 2.3: src/lab/ -> archive/lab/ - 2.4: examples/ -> archive/examples-legacy/ (SSI-based)
This commit is contained in:
parent
416fe2f180
commit
e47a9f4401
173 changed files with 11 additions and 5 deletions
30
archive/packs/nginx/autoindex-header.html
Normal file
30
archive/packs/nginx/autoindex-header.html
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/asw/asw.css">
|
||||
<title>Directory Listing</title>
|
||||
<style>
|
||||
body { display: flex; flex-direction: column; min-height: 100vh; }
|
||||
pre { /* nginx autoindex output */
|
||||
background: var(--asw-bg-elevated);
|
||||
border: 1px solid var(--asw-border);
|
||||
border-radius: var(--asw-radius-md);
|
||||
padding: 1.5rem;
|
||||
font-family: var(--asw-font-mono);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.8;
|
||||
overflow-x: auto;
|
||||
}
|
||||
pre a { color: var(--asw-accent); text-decoration: none; }
|
||||
pre a:hover { text-decoration: underline; }
|
||||
main { flex: 1; padding: 2rem; max-width: 80ch; margin: 0 auto; width: 100%; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<ul><li><a href="/"><strong>Home</strong></a></li></ul>
|
||||
</nav>
|
||||
<main>
|
||||
<h1>Directory listing</h1>
|
||||
73
archive/packs/nginx/nginx-asw.conf
Normal file
73
archive/packs/nginx/nginx-asw.conf
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
# ASW — Agentic Semantic Web site
|
||||
# Self-contained server block. Proxied from trentuna at /asw/.
|
||||
# Future: point asw.trentuna.com directly at port 8044.
|
||||
|
||||
server {
|
||||
listen 8044;
|
||||
listen [::]:8044;
|
||||
|
||||
server_name _;
|
||||
|
||||
root /home/exedev/projects/agentic-semantic-web;
|
||||
index index.html;
|
||||
ssi on;
|
||||
|
||||
error_page 403 /errors/403.html;
|
||||
error_page 404 /errors/404.html;
|
||||
error_page 500 /errors/500.html;
|
||||
error_page 502 /errors/502.html;
|
||||
error_page 503 /errors/503.html;
|
||||
|
||||
location /errors/ {
|
||||
alias /home/exedev/projects/agentic-semantic-web/errors/;
|
||||
internal;
|
||||
}
|
||||
|
||||
# Block source/build files — not for public consumption
|
||||
location ~ ^/(src|content|templates|node_modules|packs|dist)(/?$|/) {
|
||||
return 404;
|
||||
}
|
||||
location ~ \.(sh|lua|lock)$ {
|
||||
return 404;
|
||||
}
|
||||
|
||||
# docs/ — directory listing with ASW styling injected into autoindex responses.
|
||||
# Target patterns unique to nginx autoindex output:
|
||||
# - '<head><title>Index of' — only in autoindex, never in hand-crafted HTML
|
||||
# - '<body bgcolor="white">' — only in autoindex
|
||||
# Hand-crafted HTML pages in /docs/ are NOT affected.
|
||||
location /docs/ {
|
||||
autoindex on;
|
||||
try_files $uri $uri/ =404;
|
||||
|
||||
sub_filter '<head><title>Index of' '<head>
|
||||
<link rel="stylesheet" href="/asw.css">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<style>
|
||||
body{padding:2rem;max-inline-size:64ch}
|
||||
h1{font-size:1rem;font-weight:500;color:var(--text-2);margin-block-end:1.5rem}
|
||||
a{color:var(--blue-3);text-decoration:none}a:hover{text-decoration:underline}
|
||||
pre{font-family:var(--font-mono,"JetBrains Mono",monospace);line-height:1.8}
|
||||
hr{border:none;border-block-start:1px solid var(--stone-7)}
|
||||
</style>
|
||||
<title>Index of';
|
||||
sub_filter '<body bgcolor="white">' '<body>';
|
||||
sub_filter_once on;
|
||||
}
|
||||
|
||||
# lab/ — now has index.html; subdirs with autoindex still styled via sub_filter
|
||||
location /lab/ {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# Hugo demo — ASW-Hugo pack showcase (serves lab/hugo-demo/public/)
|
||||
location /hugo-demo/ {
|
||||
alias /home/exedev/projects/agentic-semantic-web/lab/hugo-demo/public/;
|
||||
index index.html;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
59
archive/packs/nginx/nginx-autoindex.conf
Normal file
59
archive/packs/nginx/nginx-autoindex.conf
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# ASW Nginx Directory Listing — config snippet
|
||||
#
|
||||
# nginx's autoindex generates its own HTML that can't be easily replaced.
|
||||
# The cleanest approach: serve autoindex JSON and render it client-side.
|
||||
#
|
||||
# This gives full control over the HTML output while keeping nginx doing
|
||||
# the work of listing directories.
|
||||
|
||||
# ── Option A: JSON autoindex + client-side renderer (recommended) ─────────────
|
||||
#
|
||||
# nginx serves directory listings as JSON; a small JS fragment renders them
|
||||
# with ASW styles. The renderer is served from /asw/autoindex.js.
|
||||
|
||||
location /files/ {
|
||||
# The directory to browse
|
||||
alias /var/www/files/;
|
||||
|
||||
autoindex on;
|
||||
autoindex_format json; # nginx ≥ 1.7.9
|
||||
|
||||
# When the path ends in / (directory request), serve our renderer
|
||||
# instead of the raw JSON. The renderer fetches the JSON itself.
|
||||
index ___nonexistent___; # disable default index file lookup
|
||||
|
||||
# Intercept directory responses and redirect to renderer
|
||||
# (requires auth_request or a small proxy; see Option B for simpler approach)
|
||||
}
|
||||
|
||||
# Serve the ASW autoindex renderer
|
||||
location = /asw/autoindex.js {
|
||||
alias /home/exedev/projects/agentic-semantic-web/packs/nginx/autoindex.js;
|
||||
}
|
||||
|
||||
|
||||
# ── Option B: add_before_body / add_after_body (simplest) ────────────────────
|
||||
#
|
||||
# nginx injects HTML before and after its generated listing.
|
||||
# This wraps the ugly default output in ASW chrome — not perfect but zero JS.
|
||||
#
|
||||
# Requires nginx built with --with-http_addition_module (default on most distros).
|
||||
|
||||
location /browse/ {
|
||||
alias /var/www/browse/;
|
||||
autoindex on;
|
||||
|
||||
# Inject ASW nav before the listing, footer after
|
||||
add_before_body /asw/autoindex-header.html;
|
||||
add_after_body /asw/autoindex-footer.html;
|
||||
}
|
||||
|
||||
location = /asw/autoindex-header.html {
|
||||
alias /home/exedev/projects/agentic-semantic-web/packs/nginx/autoindex-header.html;
|
||||
internal;
|
||||
}
|
||||
|
||||
location = /asw/autoindex-footer.html {
|
||||
alias /home/exedev/projects/agentic-semantic-web/packs/nginx/autoindex-footer.html;
|
||||
internal;
|
||||
}
|
||||
25
archive/packs/nginx/nginx-errors.conf
Normal file
25
archive/packs/nginx/nginx-errors.conf
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# ASW Nginx Error Pages — config snippet
|
||||
#
|
||||
# Paste this into your nginx server block.
|
||||
# Adjust the alias path to where your agentic-semantic-web repo lives.
|
||||
#
|
||||
# Assumes asw.css is served at /asw/asw.css
|
||||
# (see nginx-asw-css.conf for the CSS serving block)
|
||||
|
||||
# ── Error pages ──────────────────────────────────────────────────────────────
|
||||
|
||||
error_page 400 /errors/400.html;
|
||||
error_page 401 /errors/401.html;
|
||||
error_page 403 /errors/403.html;
|
||||
error_page 404 /errors/404.html;
|
||||
error_page 500 /errors/500.html;
|
||||
error_page 502 /errors/502.html;
|
||||
error_page 503 /errors/503.html;
|
||||
|
||||
# Serve error pages from the ASW repo.
|
||||
# `internal` means these URLs are only accessible via internal redirects (error_page),
|
||||
# not directly from the browser — prevents users from 200ing your error pages.
|
||||
location /errors/ {
|
||||
alias /home/exedev/projects/agentic-semantic-web/errors/;
|
||||
internal;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue