Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sphido/sphido
A rocket 🚀 fast, light-weight and flexible static site generator.
https://github.com/sphido/sphido
cms cms-framework generator markdown ssg static-site-generator
Last synced: 3 months ago
JSON representation
A rocket 🚀 fast, light-weight and flexible static site generator.
- Host: GitHub
- URL: https://github.com/sphido/sphido
- Owner: sphido
- License: mit
- Created: 2018-09-28T08:21:08.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T21:38:41.000Z (6 months ago)
- Last Synced: 2024-10-19T04:54:47.237Z (4 months ago)
- Topics: cms, cms-framework, generator, markdown, ssg, static-site-generator
- Language: TypeScript
- Homepage: https://sphido.cz
- Size: 1.73 MB
- Stars: 36
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - sphido/sphido - A rocket 🚀 fast, light-weight and flexible static site generator. (TypeScript)
README
# A rocket 🚀 fast, ️💭 lightweight and flexible static site 🤖 generator.
[](https://www.npmjs.com/package/@sphido/core)
[](https://www.npmjs.com/package/@sphido/core)
[](https://github.com/sphido/sphido/blob/main/LICENSE)
[](https://github.com/sphido/sphido/commits/main)
[](https://github.com/sphido/sphido/actions)I know, another [static site generator](https://github.com/collections/static-site-generators)! This one is different - it's totally minimalistic.
Basically, it's just two functions. The first, the `getPages()` function, allows you to retrieve a list of pages, and the `allPages()` function allows
you to iterate through them.You get a static site generator that is:
- 🚀 rocket fast
- 💭️ light-weight
- 🤘 no dependencies
- ⚡️ flexible## Installation
```shell
yarn add @sphido/core
```or
```shell
npm i @sphido/core
```## Quick Start
```javascript
#!/usr/bin/env nodeimport {dirname, join, relative} from 'node:path';
import {allPages, getPages, 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, `
${page.name} | Sphido Example
${page.content}
`);
}
```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 script
```shell
node index.ts
```## Packages
* [`@sphido/core`](https://github.com/sphido/sphido/tree/main/packages/sphido-core) - core functions `getPages()`, `allPages()`, `readFile()` and `writeFile()`
### Page extenders
* [`@sphido/frontmatter`](https://github.com/sphido/sphido/tree/main/packages/sphido-frontmatter) - frontmatter extender for `page`
* [`@sphido/hashtags`](https://github.com/sphido/sphido/tree/main/packages/sphido-hashtags) - process hashtags in `page.content`### Website components
* [`@sphido/sitemap`](https://github.com/sphido/sphido/tree/main/packages/sphido-sitemap) - generate `sitemap.xml` file
## Examples
* https://github.com/sphido/examples/
* https://sphido.cz## License
[MIT](./LICENSE)