DEV Community

CDPhu
CDPhu

Posted on

my-button-ssg

The first day of OSD600, the class was asked to create a Static Site Generator (SSG) as the first assignment of the course. We were given the freedom to choose what language the assignment was done in. I decided to name my project "my-button-ssg", as it was a simple name that represents me. I then chose my language of choice which happens to be in JavaScript.

my-button-ssg

my-button-ssg is a program that generates HTML files based on user command-line input. For example, we have 5 .txt files provided by our professor David Humphrey. These are chapters reading from the book "Sherlock-Holmes". With a simple command, my-button-ssg could convert all of these .txt files into HTML files.

Features

  1. I make my code takes the first line of the .txt file which generally was as the title and put then to the <title> </title> and add it into <h1> </h1> to the top of the <body>.
  2. used my own <footer></footer>.

Usage

Clone the source code from Github
Open the source file with Visual Studio Code
Install the npm package 'npm install' and yargs by npm -i yargs

Options

Use the command node server.js -h to get help information.
Use the command node server.js -v to check the version.
Use the command node server.js -i filename.txt to convert singular file into .\dist folder
Use the command node server.js -i .\foldername\ to convert contents of folder into .\dist folder

Links

Click Here for the DEMO link.

Link to Repository

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay