Avatar photo

Blog by

Manvel Saroyan

CMintS

| nodejs, ssg

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

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

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)}

Learn more about i18n here