DEV Community

Artem Tanyhin
Artem Tanyhin

Posted on • Edited on

SSGo - a Static Site Generator built with Go

Yeah... I know, the name isn't that creative, but this is actually a new project I just published on GitHub! Come check it out at https://github.com/devils2ndself/SSGo

So... what does it actually do?

SSGo is a simple Static Site Generator (SSG) that can turn .txt files into proper and styled HTML files. You can either pass a single .txt file or a path to a folder, where SSGo will search and turn every .txt file into HTML.

You can find setup and usage instructions in the GitHub repository :)

Usage

  • ssgo --input [in] --output [out[ - Generate HTML from .txt file at in path (can be a single .txt file or directory) to out path.

    --output is optional, default out is dist folder in current directory

  • ssgo --version - Display installed version of SSGo

  • ssgo --help - Display detailed help message

Please note, that if built locally, some users will need to use ./ssgo instead of ssgo.

Features

  • Generates HTML files for each .txt file in input.

  • Encloses every paragraph of text separated by a blank line in <p> tag.

  • If the first line of the .txt file is followed by 2 empty lines, it will be used as a title. The <title> will be assigned to it and it will be enclosed into <h1> tag instead of regular <p> - optinal feature #1.

  • The name of the generated HTML files will be the same as the original .txt files.

  • Also provides a cool style to generated HTML - optinal feature #6.

  • Generated files go to dist folder unless any other path is specified with --output flag. If the new output path does not exist, it will create a new directory to accomodate - optinal feature #2.

  • If output directory is path, each time new text is used for HTML generation, the directory will be wiped completely. Careful, don't lose valuable files there!

  • If --output is specified, the directory at path will not be erased like with dist folder. Just in case someone specifies --output C:\...

Top comments (0)