A simple i18n static website generator for NodeJS
This framework is based on Jade's templating system and SASS.
- Download the repository
- npm-install dependencies
To compile Jade or SASS just one time use in the command line:
node generator.js
To run a watcher waiting for changes use in the command line:
node watch.js
- templates/
- layout/
- template.jade
- en.json
- es.json
- xx.json
- section_name/
- template.jade
- en.json
- es.json
- xx.json
- layout/
Indicates the template list, their languages and URL's
"templates":[
{
"name": "index",
"languages": {
"en": "index",
"es": "index"
}
},
{
"name": "about",
"languages": {
"en": "about",
"es": "sobre-nosotros"
}
}
],
Defines wether to use a layout or not. The layout is not compiled.
"use_layout": true
Defines the default language. This language will compile on the root of the output folder.
"default_language": "en"
The base URL for the website navigation
"base_url": "http://localhost:3000/www/",
The type of sass you want to use. Options: "scss" or "sass".
"sass_type": "scss"
### output_dir (string)
The output directory
"output_dir": "www"
The asset's directory inside the output directory
"assets_dir": "images"
The css directory inside the output directory
"css_dir": "styles/css"
The SASS directory inside the output directory
"sass_dir": "styles/scss"
The javascript's directory inside the output directory
"javascript_dir": "js"
The font's directory inside the output directory
"fonts_dir": "fonts"
Defines wether the output will be minified or not. On true: minifies HTML and SASS.
"pretty": false
default_language
output_dir
assets_dir
css_dir
sass_dir
javascript_dir
fonts_dir
current_page
(Returns current page name)current_language
(Returns current language)
Creates an hyperlink URL to be used inside the href of </a> tags.
a(href=page_link('about')) About
It will automatically adjust the url according to the current_language
- Ignacio Ricci (VP of Product @ Mango)
- E-mail: ignacio.ricci@gmail.com
- Twitter: @ignacioricci
- Web: http://ignacioricci.com
Special thanks to: Dan Zajdband and Guillermo Paz.
MIT license. Copyright © 2015 Ignacio Ricci.