Skip to content

Static Site Generator (SSG) is a product of Tech Que Club

Notifications You must be signed in to change notification settings

dishaaggarwal26/SSG-TQ

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSG-TQ

Static Site Generator (SSG) is a product of Tech Que Club

In this project we'll build a static site generator with few features that can build static sites like building a simple portfolio-like site.

Getting Started

First install Node js : https://nodejs.org/dist/v16.18.0/node-v16.18.0-x64.msi
Install it with default settings

Watch Node js tutorial: https://www.youtube.com/watch?v=gFSXD7mOrFs

Folder structure

public/
src/
assets/
data/
pages/
partials/
layout.ejs
site.config.js

  • public: where the generated site will be.
  • src: the source of the site contents.
    src/assets: contains CSS, JS, images, etc.
    src/data: contains JSON data.
    src/pages: are the templates that will be rendered to HTML. The directory structure found here will be replicated in the resulting site.
    src/partials: contains our reusable partials.
    src/layout.ejs: contains the common page structure, with a special placeholder, where the contents of each page will be inserted.
  • site.config.js: it just exports an object that will be available in the page templates.

Why EJS templates? Because EJS is simple. There is no new template language to learn. It’s just JavaScript embedded in HTML.

Dependencies

For this basic feature set we only need three dependencies:

  • ejs
    Compile our templates to HTML.
  • fs-extra
    Adds new functions to Node’s native file-system module (fs) and add promise support for the existing ones.
  • glob
    Recursively read a directory, returning an array with all files that match an specified pattern.

Pull Request

By now you have updated the changes you made in the forked repository on your account and now it's time to add those changes to the main repository for that you need to Pull a request to the maintainer or author of the project. Let's see how it's done
  1. Go to Pull Request section on your forked repository
  2. pull1

  3. Now click on New Pull Request button (green colour) on right of your screen
  4. pull2

  5. Now click on create pull request button on the right side
  6. pull3

  7. Add the title of your pull request(specific to changes or updates you made) and explain it in the comment section
  8. pull4

  9. Now click on Create Pull request
Congrats! you did your first contribution just wait for getting your pull request approved

More Updates coming soon...
Happy learning, I hope you learned something new.

GitHub ref GitHub ref GitHub ref

About

Static Site Generator (SSG) is a product of Tech Que Club

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 77.4%
  • CSS 21.3%
  • JavaScript 1.3%