https://github.com/sambhav2612/staticgen
Simple Static Page Generator in NodeJS.
https://github.com/sambhav2612/staticgen
nodejs static-page-generator
Last synced: 2 months ago
JSON representation
Simple Static Page Generator in NodeJS.
- Host: GitHub
- URL: https://github.com/sambhav2612/staticgen
- Owner: sambhav2612
- License: mit
- Created: 2018-01-27T05:35:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T22:00:46.000Z (over 2 years ago)
- Last Synced: 2025-01-22T01:36:28.656Z (4 months ago)
- Topics: nodejs, static-page-generator
- Language: HTML
- Homepage:
- Size: 240 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# staticgen
Simple Static Page Generator in NodeJS.
## Installation
```bash
$ 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:
```markdown
# Home pageHello world!
[Link to another page](./other.html)
```and JSON spec in pages_meta dir:
```json
{
"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
[](https://github.com/sambhav2612/staticgen/blob/master/LICENSE)