DEV Community

irenejoeunpark
irenejoeunpark

Posted on

Static Site Generator

Built a static site generator (SSG) using Java.

Feel free to check it out:
https://github.com/irenejoeunpark/ssgApplication

Example:
Given text file textFile.txt

Sample Text File This is a sample text file to test the ssg created by Irene 
Enter fullscreen mode Exit fullscreen mode

Run:

 java -jar out\artifacts\ssgApplication_jar\ssgApplication.jar -i sources/textFile.txt 
Enter fullscreen mode Exit fullscreen mode

textFile.html will be generated in the folder called "dist"

<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <STYLE type="text/css"> H1 {border-width: 1; border: solid; text-align: center; font-family: Arial, Helvetica, sans-serif} p{font-family: Arial, Helvetica, sans-serif;} body {background-color: #d6ecf3;padding-left: 10%;padding-right:10%; padding-top: 0.5%;line-height: 1.5;text-align: center;} </STYLE> <title>TextFile</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <h1>Sample Text File</h1><br/><br/><p></p><br/> <p></p><br/> <p>This is a sample text file to test the ssg created by Irene</p><br/></body> </html> 
Enter fullscreen mode Exit fullscreen mode

Option

-v or --version : display version of the application
-h or --help : display the list of options and its description
-i or --input : allow to pass input file(s)

Remark

More features will be added. I am considering to create more argument options by using picocli.

Top comments (0)