diff --git a/src/pages/admin/pages/demo-generator.astro b/src/pages/admin/pages/demo-generator.astro
new file mode 100644
index 0000000..a373d73
--- /dev/null
+++ b/src/pages/admin/pages/demo-generator.astro
@@ -0,0 +1,218 @@
+---
+// Demo Page Generator - Uses Real Database Content
+import AdminLayout from '@/layouts/AdminLayout.astro';
+import { pool } from '@/lib/db';
+
+// Get site
+const { rows: sites } = await pool.query<{id: string; domain: string}>('SELECT id, domain FROM sites LIMIT 1');
+const site = sites[0];
+
+if (!site) {
+ return Astro.redirect('/admin/sites');
+}
+
+// Get content fragments if they exist
+const { rows: fragments } = await pool.query<{fragment_type: string; content: any}>(
+ 'SELECT fragment_type, content FROM content_fragments LIMIT 10'
+);
+
+// Get article templates if they exist
+const { rows: templates } = await pool.query<{name: string; template: any}>(
+ 'SELECT name, template FROM article_templates ORDER BY created_at DESC LIMIT 5'
+);
+
+// Build demo page HTML
+let demoHTML = `
+
+
+
+
+ About Your Platform
+
+ You have ${fragments.length} content fragments and ${templates.length} article templates in your database.
+ This demonstrates the direct database integration working perfectly!
+
+
+`;
+
+// Add content fragments section if exist
+if (fragments.length > 0) {
+ demoHTML += `
+
+ 📦 Your Content Fragments
+
+ `;
+
+ fragments.slice(0, 6).forEach(frag => {
+ demoHTML += `
+
+
+ ${frag.fragment_type || 'Content Block'}
+
+
+ ${JSON.stringify(frag.content).substring(0, 100)}...
+
+
+ `;
+ });
+
+ demoHTML += `
+
+
+ `;
+}
+
+// Add templates section if exist
+if (templates.length > 0) {
+ demoHTML += `
+
+ 📄 Your Article Templates
+
+ `;
+
+ templates.forEach(tmpl => {
+ demoHTML += `
+
+
+ ✨ ${tmpl.name}
+
+
+ ${JSON.stringify(tmpl.template, null, 2).substring(0, 300)}...
+
+
+ `;
+ });
+
+ demoHTML += `
+
+
+ `;
+}
+
+demoHTML += `
+
+ 🚀 Ready to Build More?
+
+ This page demonstrates that your database content is accessible and renders perfectly.
+
+
+
+
+
+
+`;
+
+// Create the page using the API
+const pageData = {
+ site_id: site.id,
+ name: "Database Demo Page",
+ route: "/demo",
+ html_content: demoHTML,
+ meta_title: `${site.domain} - Database Integration Demo`,
+ meta_description: "Auto-generated demo page showing content from the database",
+ status: "published"
+};
+
+let createdPage = null;
+try {
+ const response = await fetch(`${Astro.url.origin}/api/shim/pages/create`, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Authorization': `Bearer ${import.meta.env.GOD_MODE_TOKEN}`
+ },
+ body: JSON.stringify(pageData)
+ });
+
+ if (response.ok) {
+ createdPage = await response.json();
+ }
+} catch (error) {
+ console.error('Failed to create demo page:', error);
+}
+---
+
+
+
+
+
+
+
📊 Database Demo Page
+
Auto-generated page using your database content
+
+
+ ← Back to Admin
+
+
+
+ {createdPage ? (
+
+
✅ Demo Page Created!
+
+ Your demo page has been successfully created from database content.
+
+
+
+
+
+ ID: {createdPage.id}
+ Route: {createdPage.route}
+ Status: {createdPage.status}
+
+
+
+ ) : (
+
+
⚠️ Page Creation
+
+ Generating demo page... refresh if needed.
+
+
+ )}
+
+
+
Database Content Found:
+
+
+
{fragments.length}
+
Content Fragments
+
+
+
{templates.length}
+
Article Templates
+
+
+
+
+
+
diff --git a/src/pages/admin/pages/new.astro b/src/pages/admin/pages/new.astro
index 4848d5f..a08e85e 100644
--- a/src/pages/admin/pages/new.astro
+++ b/src/pages/admin/pages/new.astro
@@ -27,7 +27,7 @@ if (!siteId) {
{
window.location.href = `/admin/pages/${page.id}/edit`;
diff --git a/src/pages/admin/posts/new.astro b/src/pages/admin/posts/new.astro
index 80ce377..15d939f 100644
--- a/src/pages/admin/posts/new.astro
+++ b/src/pages/admin/posts/new.astro
@@ -27,7 +27,7 @@ if (!siteId) {
{
window.location.href = `/admin/posts/${post.id}/edit`;