SSGo - a Static Site Generator built with Go

devils2ndself

Artem Tanyhin

Posted on September 18, 2022

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:\...

💖 💪 🙅 🚩
devils2ndself
Artem Tanyhin

Posted on September 18, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Continuous Integration and Go
opensource Continuous Integration and Go

November 17, 2022

SSGo - a Static Site Generator built with Go
opensource SSGo - a Static Site Generator built with Go

September 18, 2022