Sphido, Yet Another KISS Static Site Generator (SSG), But FAST.

Sphido, Yet Another KISS Static Site Generator (SSG), But FAST.

Sphido is an amazing open-source rocket 🚀 fast, light-weight, and flexible static site generator. It offers a multitude of benefits for developers and users alike. With its minimalistic approach, Sphido focuses on simplicity and efficiency. By utilizing just two functions, it provides a seamless experience for website creators.

The first function, getPages(), empowers you to effortlessly retrieve a comprehensive list of pages within your website. This allows for easy navigation and management of your content. The second function, allPages(), takes it a step further by enabling you to iterate through each page individually, facilitating dynamic and personalized experiences for your users.

One of the remarkable aspects of Sphido is its independence. It doesn't rely on any external dependencies, making it extremely reliable and easy to use right out of the box. Whether you are a seasoned developer or a beginner, Sphido is designed to enhance your workflow and empower you to create stunning websites.

Features

  • Clean code
  • Easy to setup, use and install
  • Markdown support
  • Frontmatter support
  • Hashtags support
  • Sitemap support with official default extensions

Install

using Yarn.

yarn add @sphido/core

or with NPM.

npm i @sphido/core

Quick Start

#!/usr/bin/env node

import {dirname, relative, join} from 'node:path';
import {getPages, allPages, readFile, writeFile} from '@sphido/core';
import slugify from '@sindresorhus/slugify';
import {marked} from 'marked';

const pages = await getPages({path: 'content'}, // ... extenders
	(page) => {
		page.slug = slugify(page.name) + '.html';
		page.dir = dirname(page.path);
	});

for (const page of allPages(pages)) {
	page.output = join('public', relative('content', page.dir), page.slug);
	page.content = marked(await readFile(page.path));

	await writeFile(page.output, `<!DOCTYPE html>
		<html lang="en" dir="ltr">
		<head>
			<meta charset="UTF-8">
			<script src="https://cdn.tailwindcss.com?plugins=typography"></script>
			<title>${page.name} | Sphido Example</title>
		</head>
		<body class="prose mx-auto my-6">${page.content}</body>
		<!-- Generated by Sphido from ${page.path} -->
		</html>
	`);
}

Sphido requires Node 16.x and newer. To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

Run and Generate your Site

Simply run: node index.js.

License

  • MIT License

Resources

Sphido / Home
GitHub - sphido/sphido: A rocket 🚀 fast, light-weight and flexible static site generator.
A rocket 🚀 fast, light-weight and flexible static site generator. - GitHub - sphido/sphido: A rocket 🚀 fast, light-weight and flexible static site generator.







Open-source Apps

9,500+

Medical Apps

500+

Lists

450+

Dev. Resources

900+

Read more