zyros
Version:
A developer-friendly static site generator built with Next.js and Tailwind CSS. Transform a simple JSON file into a beautiful, fast static website.
47 lines (39 loc) ⢠1.98 kB
JavaScript
const { spawn } = require('child_process');
const fs = require('fs');
const path = require('path');
console.log('š Starting zyros development server...\n');
// Check if site.json exists
const siteJsonPath = path.join(process.cwd(), 'public', 'site.json');
if (!fs.existsSync(siteJsonPath)) {
console.log('ā ļø No site.json found. Creating a sample configuration...\n');
const sampleConfig = {
site: {
title: "My Awesome Blog",
theme: "ocean",
description: "A beautiful static site built with zyros"
},
pages: [
{
title: "Welcome to zyros",
slug: "welcome",
description: "Get started with the most developer-friendly static site generator",
content: "# Welcome to zyros\n\nCongratulations! You've successfully set up your new static site.\n\n## What's Next?\n\n1. **Customize your content** - Edit `public/site.json` to add your own pages\n2. **Choose a theme** - Try different themes like `dark`, `minimal`, `sunset`, or `neon`\n3. **Write in Markdown** - Use full Markdown syntax with code highlighting\n4. **Deploy anywhere** - Run `npm run export` to generate static files\n\n## Features\n\n- ā” Lightning fast static generation\n- šØ 8 beautiful themes\n- š Built-in search with ā+K\n- š± Mobile-first responsive design\n- š Dynamic theme switching\n\nHappy building! š"
}
]
};
fs.writeFileSync(siteJsonPath, JSON.stringify(sampleConfig, null, 2));
console.log('ā
Created sample site.json configuration\n');
}
// Start the development server
console.log('š„ Starting Next.js development server...\n');
const dev = spawn('npm', ['run', 'dev'], {
stdio: 'inherit',
shell: true
});
dev.on('close', (code) => {
console.log(`\nš Development server stopped with code ${code}`);
});
dev.on('error', (err) => {
console.error('ā Failed to start development server:', err);
});