aiplang 2.7.3 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/aiplang.js +10 -2
- package/package.json +1 -1
- package/server/server.js +1 -1
package/bin/aiplang.js
CHANGED
|
@@ -5,7 +5,7 @@ const fs = require('fs')
|
|
|
5
5
|
const path = require('path')
|
|
6
6
|
const http = require('http')
|
|
7
7
|
|
|
8
|
-
const VERSION = '2.7.
|
|
8
|
+
const VERSION = '2.7.4'
|
|
9
9
|
const RUNTIME_DIR = path.join(__dirname, '..', 'runtime')
|
|
10
10
|
const cmd = process.argv[2]
|
|
11
11
|
const args = process.argv.slice(3)
|
|
@@ -734,14 +734,22 @@ function renderPage(page, allPages) {
|
|
|
734
734
|
const hydrate=needsJS?`\n<script>window.__AIPLANG_PAGE__=${config};</script>\n<script src="./aiplang-hydrate.js" defer></script>`:''
|
|
735
735
|
const customVars=page.customTheme?genCustomThemeVars(page.customTheme):''
|
|
736
736
|
const themeVarCSS=page.themeVars?genThemeVarCSS(page.themeVars):''
|
|
737
|
+
// Extract app name from nav brand if available
|
|
738
|
+
const _navBlock = page.blocks.find(b=>b.kind==='nav')
|
|
739
|
+
const _brand = _navBlock?.brand || ''
|
|
740
|
+
const _title = _brand ? `${esc(_brand)} — ${esc(page.id.charAt(0).toUpperCase()+page.id.slice(1))}` : esc(page.id.charAt(0).toUpperCase()+page.id.slice(1))
|
|
737
741
|
return `<!DOCTYPE html>
|
|
738
742
|
<html lang="en">
|
|
739
743
|
<head>
|
|
740
744
|
<meta charset="UTF-8">
|
|
741
745
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
742
|
-
<title>${
|
|
746
|
+
<title>${_title}</title>
|
|
743
747
|
<link rel="canonical" href="${esc(page.route)}">
|
|
744
748
|
<meta name="robots" content="index,follow">
|
|
749
|
+
<meta name="description" content="${esc((()=>{const h=page.blocks.find(b=>b.kind==='hero');if(!h)return '';const m=h.rawLine&&h.rawLine.match(/\{([^}]+)\}/);if(!m)return '';const p=m[1].split('>');const s=p[0].split('|')[1];return s?s.trim():''})())}">
|
|
750
|
+
<meta property="og:title" content="${_title}">
|
|
751
|
+
<meta property="og:type" content="website">
|
|
752
|
+
<meta property="og:type" content="website">
|
|
745
753
|
<style>${css(page.theme)}${customVars}${themeVarCSS}</style>
|
|
746
754
|
</head>
|
|
747
755
|
<body>
|
package/package.json
CHANGED
package/server/server.js
CHANGED
|
@@ -1435,7 +1435,7 @@ async function startServer(aipFile, port = 3000) {
|
|
|
1435
1435
|
|
|
1436
1436
|
// Health
|
|
1437
1437
|
srv.addRoute('GET', '/health', (req, res) => res.json(200, {
|
|
1438
|
-
status:'ok', version:'2.7.
|
|
1438
|
+
status:'ok', version:'2.7.4',
|
|
1439
1439
|
models: app.models.map(m=>m.name),
|
|
1440
1440
|
routes: app.apis.length, pages: app.pages.length,
|
|
1441
1441
|
admin: app.admin?.prefix || null,
|