šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
DemoInstallSign in
Socket

jelenjs-ssg

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jelenjs-ssg

Static Site Generation for JelenJS framework

0.1.0
latest
npm
Version published
Maintainers
1
Created
Source

JelenJS SSG

Static Site Generation for JelenJS framework.

Features

  • šŸš€ Static Site Generation at build time
  • šŸ“ File-based routing with dynamic routes
  • šŸ“Š Data fetching with getStaticProps and getStaticPaths
  • šŸŽÆ SEO optimized (sitemap.xml, robots.txt)
  • ⚔ Parallel page generation

Usage

import { generateStaticSite } from 'jelenjs-ssg';

const config = {
  pagesDir: './pages',
  outputDir: './dist',
  baseUrl: 'https://mysite.com',
  defaultTitle: 'My Site',
  optimization: {
    minifyHTML: true,
    generateSitemap: true,
    generateRobots: true
  }
};

const result = await generateStaticSite(config);

Page Structure

pages/
ā”œā”€ā”€ index.tsx          # /
ā”œā”€ā”€ about.tsx          # /about
ā”œā”€ā”€ blog/
│   ā”œā”€ā”€ index.tsx      # /blog
│   └── [slug].tsx     # /blog/:slug (dynamic)

Data Fetching

// Static props
export async function getStaticProps() {
  return {
    props: { data: await fetchData() }
  };
}

// Dynamic paths
export async function getStaticPaths() {
  const items = await fetchItems();
  return items.map(item => ({ params: { id: item.id } }));
}

Configuration

interface SSGConfig {
  pagesDir: string;           // Pages directory
  outputDir: string;          // Output directory
  baseUrl?: string;           // Site base URL
  defaultTitle?: string;      // Default page title
  meta?: MetaTag[];          // Global meta tags
  styles?: string[];         // CSS files
  clientScripts?: string[];  // JS files
  optimization?: {
    minifyHTML?: boolean;
    generateSitemap?: boolean;
    generateRobots?: boolean;
  };
}

License

MIT

Keywords

jelenjs

FAQs

Package last updated on 24 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts