# @jeffess/factorio-blueprint-static-site-generator

> Render a simple static site for a collection of Factorio blueprints

Latest version **1.0.5** (published 2021-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jeffess/factorio-blueprint-static-site-generator
pnpm add @jeffess/factorio-blueprint-static-site-generator
yarn add @jeffess/factorio-blueprint-static-site-generator
bun add @jeffess/factorio-blueprint-static-site-generator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-05-15 |
| First published | 2021-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 42.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jeFFeSS |
| Maintainers | jeffess |

## Links

- npm: https://www.npmjs.com/package/@jeffess/factorio-blueprint-static-site-generator
- npm.io page: https://npm.io/package/@jeffess/factorio-blueprint-static-site-generator

## Dependencies (7)

- [ejs](https://npm.io/package/ejs.md) ^3.1.6
- [glob](https://npm.io/package/glob.md) ^7.1.7
- [luxon](https://npm.io/package/luxon.md) ^1.26.0
- [slugify](https://npm.io/package/slugify.md) ^1.5.1
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [relateurl](https://npm.io/package/relateurl.md) ^0.2.7
- [html-minifier-terser](https://npm.io/package/html-minifier-terser.md) ^5.1.1

## Recent versions

- 1.0.5 (latest) — 2021-05-15

## README

This project generates a simple static website for your Factorio blueprints.  All the internal links it generates
will be relative links, so the generated output can be placed anywhere (for example, in a subfolder of another site)

### Demo

Clone this repo and run `npm run demo` and it should open your browser.  You can look in the `blueprints/` directory
in this repo to see how it is laid out.

### Example

Imagine you have a folder like this:

```
blueprints/
  Circuits/
    Combinators.txt
    Kovarex.txt
  Solar Power.txt
  Rocket Fuel.txt
```

This will generate some HTML files, like this:

```
public/
  circuits/
    index.html
    combinators/index.html
    kovarex/index.html
  solar-power/index.html
  rocket-fuel/index.html
```

Notice how it has chosen URL-friendly names automatically.

You can nest folders and name them however they want.  Every folder will include an autogenerated listing
with links for each blueprint in the folder.

### Usage

Just use a Node script like this:

```js
const siteGenerator = require('@jeffess/factorio-blueprint-static-site-generator');
siteGenerator.build('blueprints', 'public');
```

It will read your blueprints folder and write the site to `public/`

Please note that any extra files in `public/` will be deleted.

### Blueprint Details

The name and description of your blueprint will show up on the details page for your blueprint.  Change
the title and description in Factorio before exporting your blueprint.

If your blueprint does not have a title, the filename will be used as the title instead.

### Folder Readme

You may optionally put a file named `_readme.txt` in your `blueprints/` folder or any sub-folder.  The generated listing
page for that folder will include that text at the top.  This is helpful for adding introductions or more information
about a group of blueprints.

For example, if you put text into `blueprints/Circuit Network/_readme.txt`, then that text would appear at the top
of the directory listing in your site at `/circuit-network/index.html`

### Custom HTML Header

If you would like to add a little branding to the page, you may optionally put a file named `_header.html` directly
inside your `blueprints/` folder.  This HTML will be injected in the body of each generated page.  Here is an example:

```html
<style>h1.custom-header { color: #16a085; }</style>
<h1 class="custom-header">jeFFeSS Blueprint Library</h1>
```

### Custom Files

You may optionally include a directory named `_static` directly inside your `blueprints/` folder.  These files will
be copied verbatim into the generated output directory.  For example, `blueprints/_static/robots.txt` would be copied
into `public/robots.txt`.

This is useful if you'd like to include a logo or other image in your custom header.

### License

This software is licensed under the MIT license.  Please read [LICENSE.txt](./LICENSE.txt) for details.

---
_Source: https://npm.io/package/@jeffess/factorio-blueprint-static-site-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
