Creating my static site generator

Hi everyone,

This week, I created my own SSG (static site generator) called nan1-ssg using JavaScript and node.js. My SSG will generate .html files from .txt files as specified by the user.

Some features of nan1-ssg are:

Generating valid HTML5 file…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Neil An

Hi everyone,

This week, I created my own SSG (static site generator) called nan1-ssg using JavaScript and node.js. My SSG will generate .html files from .txt files as specified by the user.

Some features of nan1-ssg are:

  • Generating valid HTML5 files from .txt files and placed in the dist directory
  • An index.html file is created which contain relative links to the generated HTML files
  • Each HTML file uses a default stylesheet to improve beauty and readability

Usage

To use my SSG, node.js is required. After node.js is installed follow these steps to use the tool:

To use this tool:

  1. Clone or download and extract the repo to a location on your computer.

  2. Open a terminal/command window and navigate to the location where the tool is.

  3. Run the npm install command:

npm install
  1. Run the npm link command:
npm link
  1. Start using the tool! For example:
nan1-ssg [-option]

A list of options:

Option Details
-v, --version Will display the name and version of the tool.
-h, --help Will display a help message, showing options and usage.
-i , --input Gives the tool a filename to generate HTML files with. The filename can be a file or a directory.

Examples

For a text file:

node main -i hello.txt

For a directory:

node main -i Sherlock-Holmes-Selected-Stories

Files that are nested:

nan1-ssg -i "./Sherlock-Holmes-Selected-Stories/Silver Blaze.txt"

Files containing spaces:

node main -i "file with spaces.txt"

Link to repo: nan1-ssg

Example of generated static site: https://neilan99.github.io/


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Neil An


Print Share Comment Cite Upload Translate Updates
APA

Neil An | Sciencx (2022-09-13T22:16:24+00:00) Creating my static site generator. Retrieved from https://www.scien.cx/2022/09/13/creating-my-static-site-generator/

MLA
" » Creating my static site generator." Neil An | Sciencx - Tuesday September 13, 2022, https://www.scien.cx/2022/09/13/creating-my-static-site-generator/
HARVARD
Neil An | Sciencx Tuesday September 13, 2022 » Creating my static site generator., viewed ,<https://www.scien.cx/2022/09/13/creating-my-static-site-generator/>
VANCOUVER
Neil An | Sciencx - » Creating my static site generator. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/09/13/creating-my-static-site-generator/
CHICAGO
" » Creating my static site generator." Neil An | Sciencx - Accessed . https://www.scien.cx/2022/09/13/creating-my-static-site-generator/
IEEE
" » Creating my static site generator." Neil An | Sciencx [Online]. Available: https://www.scien.cx/2022/09/13/creating-my-static-site-generator/. [Accessed: ]
rf:citation
» Creating my static site generator | Neil An | Sciencx | https://www.scien.cx/2022/09/13/creating-my-static-site-generator/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.