tamago v1.0.23
卵 Tamago
Static website generator, built with NodeJS.
Install
npm i tamago
Init a website
tamago init "Website name"
It creates the website-name folder with these sub-folders:
- assets
- favicons
- fonts
- img
- js
- libs
- scss
- files
- pages
- posts
- templates
Build a website
cd website-name
tamago build
It creates/updates the public folder with these sub-folders:
- assets
- css
- fonts
- img
- js
- libs
- files
- pages
- posts
- a folder for each taxonomy
- favicons right here
Settings
Settings.json can override these settings:
title: stringbaseurl: string, like "http://example.com"basepath: string, the subpath of the website, like/blog, defaults to/contentTypes: array, defaults to["pages", "posts"]home: object, see below for detailspaginate: int, number of posts per page, default to10indexesNames: array of indexes names, defaults to['posts'], see details belowtaxonomiesNames: array of taxonomy names, defaults to['tags']dateFormat: string, defaults toD MMMM YYYY, use https://date-fns.org/v2.1.0/docs/formatmapZoom: int, defaults to12, see below for detailsimageFormats: array of image formats, see below for details
Indexes
Indexes are lists of contents, ordered in antechronological order, and paginated.
Each contentTypes set in indexesNames creates a webpage listing their contents.
Also, indexes are built for each taxonomiesNames.
Home
The home object defaults to the list of the 10 latest posts, like:
{
"where": "indexes",
"slug": "posts"
}To display the page /pages/home.md, you can set:
{
"where": "pages",
"slug": "home"
}To display the 10 latest posts with the tag sharkz:
{
"where": "indexes",
"slug": "tags-sharkz"
}Image formats
Rename or add formats with this array of image formats objects:
imageFormats: [
{
name: 'thumbnail',
width: 300,
height: 200
},
{
name: 'large',
width: 960,
height: 480
}
]Address field and map
If your frontmatter has an 'address' field, it outputs has a map, via the Leaflet library.
⚠️ You must install Leaflet by yourself in the assets/libs folder.
Templates
The templating system is Handlebars
Every content type is rendered through the default template files, named like article--[VIEW].tpl.
It can be overriden by creating files like article--[CONTENT-TYPE]--[VIEW].tpl.
Example: article--event--full.tpl will override the template article--full.tpl for a new event content type.
Content object
titlebody: partial html contenturlslug- each field found in the frontmatter: date, image, tags...
styles: arrayscripts: arrayhasImage: boolimageDerivatives: objecttaxonomies: object
Gitlab pages CI
Example of a .gitlab-ci.yml file:
image: node:latest
before_script:
- npm install tamago
pages:
stage: deploy
script:
- ./node_modules/tamago/bin/tamago.js build
artifacts:
paths:
- public
only:
- master6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago