diff --git a/projects/business/src/pdf-api/public/privacy.html b/projects/business/src/pdf-api/public/privacy.html
index 340a417..aad1ddb 100644
--- a/projects/business/src/pdf-api/public/privacy.html
+++ b/projects/business/src/pdf-api/public/privacy.html
@@ -3,63 +3,36 @@
-
-
-
-
+
Privacy Policy — DocFast
+
+
diff --git a/projects/business/src/pdf-api/public/terms.html b/projects/business/src/pdf-api/public/terms.html
index 925282b..31a24d1 100644
--- a/projects/business/src/pdf-api/public/terms.html
+++ b/projects/business/src/pdf-api/public/terms.html
@@ -3,63 +3,36 @@
-
-
-
-
+
Terms of Service — DocFast
+
+
diff --git a/projects/business/src/pdf-api/scripts/build-pages.js b/projects/business/src/pdf-api/scripts/build-pages.js
index 8bc408f..3b08b46 100644
--- a/projects/business/src/pdf-api/scripts/build-pages.js
+++ b/projects/business/src/pdf-api/scripts/build-pages.js
@@ -6,12 +6,13 @@
* - Reads page sources from templates/pages/*.html
* - Reads partials from templates/partials/*.html
* - Replaces {{> partial_name}} with partial content
- * - Supports {{title}} variable (set via comment at top)
+ * - Supports metadata comments at top of page files
+ * - Replaces {{key}} variables with extracted metadata
* - Writes output to public/
*/
-import { readFileSync, writeFileSync, readdirSync, mkdirSync } from 'node:fs';
-import { join, basename } from 'node:path';
+import { readFileSync, writeFileSync, readdirSync } from 'node:fs';
+import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
@@ -37,13 +38,13 @@ console.log(`Processing ${pages.length} pages...`);
for (const file of pages) {
let content = readFileSync(join(PAGES_DIR, file), 'utf-8');
- // Extract title from comment
- let title = '';
- const titleMatch = content.match(/^/);
- if (titleMatch) {
- title = titleMatch[1];
- // Remove the title comment from output
- content = content.replace(/^\n?/, '');
+ // Extract all metadata comments from the top
+ const vars = {};
+ while (true) {
+ const m = content.match(/^\n?/);
+ if (!m) break;
+ vars[m[1]] = m[2];
+ content = content.slice(m[0].length);
}
// Replace {{> partial_name}} with partial content (support nested partials)
@@ -58,8 +59,12 @@ for (const file of pages) {
});
}
- // Replace {{title}} variable
- content = content.replace(/\{\{title\}\}/g, title);
+ // Replace {{variable}} with extracted metadata
+ content = content.replace(/\{\{([a-zA-Z_-]+)\}\}/g, (match, key) => {
+ if (key in vars) return vars[key];
+ console.warn(` Warning: variable "${key}" not defined in ${file}`);
+ return match;
+ });
// Write output
const outPath = join(OUTPUT_DIR, file);
diff --git a/projects/business/src/pdf-api/templates/pages/impressum.html b/projects/business/src/pdf-api/templates/pages/impressum.html
index e200409..65a5e33 100644
--- a/projects/business/src/pdf-api/templates/pages/impressum.html
+++ b/projects/business/src/pdf-api/templates/pages/impressum.html
@@ -52,4 +52,4 @@
{{> footer}}
-
\ No newline at end of file
+
diff --git a/projects/business/src/pdf-api/templates/pages/index.html b/projects/business/src/pdf-api/templates/pages/index.html
index e2e02da..2c9ecec 100644
--- a/projects/business/src/pdf-api/templates/pages/index.html
+++ b/projects/business/src/pdf-api/templates/pages/index.html
@@ -2,8 +2,9 @@
-{{head}}
-
{{title}}
+
+
+
DocFast — HTML & Markdown to PDF API
@@ -14,11 +15,33 @@
+
+
+
+
+
+
-{{nav}}
+{{> nav-home}}
@@ -361,7 +407,7 @@ html, body {
-{{footer}}
+{{> footer}}
diff --git a/projects/business/src/pdf-api/templates/pages/terms.html b/projects/business/src/pdf-api/templates/pages/terms.html
index f80a7ac..98d4b2e 100644
--- a/projects/business/src/pdf-api/templates/pages/terms.html
+++ b/projects/business/src/pdf-api/templates/pages/terms.html
@@ -6,6 +6,8 @@
{{title}}
+
+