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

1.0.5 • Public • Published

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:

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:

<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 for details.

Readme

Keywords

none

Package Sidebar

Install

npm i @jeffess/factorio-blueprint-static-site-generator

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

43.8 kB

Total Files

18

Last publish

Collaborators

  • jeffess