Code Monkey home page Code Monkey logo

staticgen's Introduction

staticgen

Simple Static Page Generator in NodeJS.

Installation

$ git clone https://github.com/sambhav2612/staticgen.git nodejs-static-webpage-generator
$ cd nodejs-static-webpage-generator
$ npm install
$ npm run start

Creating pages

You can generate html pages by creating markdown files in /pages and providing page specifications from JSON files in /pages_meta. Only costraint is that the file name has be same in both directories for successful generation of html pages with the same name as provided earlier for both markdown and json files.

An example to markdown file in pages dir:

# Home page

Hello world!

[Link to another page](./other.html)

and JSON spec in pages_meta dir:

{
    "lang": "en",
    "title": "Homepage",
    "stylesheets": ["./css/style.css"],
    "scripts": ["./js/main.js"],
    "charset": "utf-8",
    "description": "This is a page",
    "keywords": "page, sample",
    "author": "Sambhav Jain",
    "favicon": "./images/next.svg",
    "viewport": "width=device-width, initial-scale=1",
    "extra": []
}

You can edit the attributes according to html. The icon can be manually replaced as well. The styling (style.css in /css) can be manually changed according to need as can be changed the font (from pages_template.js in /build_scripts).

However, pages can be built without supplying JSON spec as the generator keeps a default copy of the spec in case user does not explicitly defines one to use.

The pages are generated in the build directory on root which you can use to deploy on your site as usual.

Dependencies

  • Git
  • NodeJS and NPM (NPm comes with NodeJS)
  • live-server
  • nodemon
  • concurrently
  • markdown-it
  • fs-extra

License

GitHub license

staticgen's People

Contributors

sambhav2612 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.