CMintS
In mid 2017 I was searching for an Static Site Generator(SSG) that would work perfectly both for my single and multi-language websites, but I was surprised not being able to find one that wouldn't require me adding bunch of 3-rd party plugins, do a lot of customization work and have a scalable i18n implementation.
Today I'm happy to announce release of the CMintS! CMS and Static Site Generator Which is also powering current blog.
What is CMintS?
CMintS is a CMS and Static Site Generator for single and multi-language websites creation. Learn more about CMintS at https://cmints.io/. It's an open source project and every related repository can be found in the CMintS GitHub organization.
You can either install CMintS globally as it's described in the installation documentation or as a local dependency by following the quick start tutorial.
Single and multi-language website starters can be found at https://single.cmints.io/ and https://multi.cmints.io/ accordingly.
Project Structure
Structure of the CMintS is quite straightforward:
├── public
├── locales
├── pages
├── theme
└── config.js
- /locales - folder contains translations of the multi-language website project.
- /public - stores all your static content, images, CSS and etc.
- /pages - here goes your website page contents.
- /theme - theme of the website.
- config.js - used for overwriting various website default configurations, generation options and minification setup.
Theme
theme
├── layouts
│ ├── partials
│ │ ├── footer.ejs
│ │ └── header.ejs
│ ├── default.ejs
│ └── home.ejs
├── less
│ ├── _footer.less
│ ├── _header.less
│ ├── index.less
│ └── main.less
└── js
├── _contextMenu.js
└── main.js
- /theme/layout - CMintS is using EJS as a templating engine for creating layouts. EJS is a simple templating language that lets you generate HTML markup while writing plain JavaScript.
- /theme/less -
.less
files are being processed into thepublic/css
directory, only filenames starting with "_" are not compiled into the target directory, but yet they can be used by other less files. You can also setup processing options and minification in the config.js. - /theme/js -
CMintS is using Node.js-style modules and makes Theme functionality
implementation modular out of the box. JavaScript files that are placed in
theme/js
directory and don't have starting_
in the filename are being compiled into thepublic/js
directory. You can also setup compilation options and minification in the config.js
Pages
pages
├── about
│ └── team.md
├── about.md
├── documentation
│ ├── getting-started
│ │ ├── configuration.md
│ │ ├── index.md
│ │ └── _structure.md
│ └── i18n
│ ├── index.md
│ └── markdown.md
├── index.ejs
└── news.md
The folder structure inside of the pages directory reflects actual URL path when the page is requested(unless a permalink is specified).
Front Matter can be used for pages metadata specification:
---
title: Front Matter
description: Front Matter is a powerful tool for adding metadata to the pages
categories: [documentation, i18n]
showToc: true
---
Here are page types suported by CMintS:
i18n
locales
├── de
│ ├── header.json
│ └── news.json
├── en
│ ├── header.json
│ └── news.json
└── ru
├── about
│ └── teams.json
├── header.json
├── index.json
└── news.json
Locale files hold list of the translations strings, the translation strings consist of stringid, message and an optional description.
{
"heading-main": {
"description": "Heading of the main page",
"message": "Заголовок"
}
}
Source language strings can be defined in pages or theme layouts by placing them inside of opening and closing curly braces containing stringId, optional description and actual text:
{stringId[Description] Source text}
Or by defining stringId and locale file path:
{stringId(path)}