Pages

Content of the website goes to the pages directory. Pages can be written in Markdown, EJS or HTML. The folder structure inside of the pages directory reflects actual path when the page is requested(unless a permalink is specified), which means that considering structure below:

pages
├── about
│   └── team.md
├── about.md
├── documentation
│   ├── getting-started
│   │   ├── configuration.md
│   │   ├── index.md
│   │   └── _structure.md
│   └── i18n
│       ├── index.md
│       └── markdown.md
├── index.ejs
└── news.md

When the server is running pages can be accessed by the URLs below:

  • pages/about/team.md -> http://localhost:3000/about/team.
  • pages/documentation/i18n/index.md -> http://localhost:3000/documentation/i18n
  • index.ejs -> http://localhost:3000

Front Matter

Front Matter helps easily define matedata(ex.: title, description and etc.) for the page, Ex.:

---
title: Front Matter
description: Front Matter is a powerful tool for adding metadata to the pages
categories: [documentation, i18n]
showToc: true
---
Learn more

Page types

Currently there are 3 type of pages are supported by CMintS:

Markdown

In order to write page content using Markdown, just assign .md extension to the file. CMintS uses CommonMark in order to support Markdown pages:

---
title: About Markdown
description: Markdown is a lightweight markup language with plain text formatting syntax
---

## Subheading of the page

Here goes paragraph for the subheading

- list item1
- list item2
- list item3
Learn more

ejs

ejs is a templating language and can be used for more complex pages. In order to create them just assign .ejs extension to the file. ejs pages can also access page's metadata and website helpers.

---
items: 
  - Apples
  - Oranges
  - Cherries
---

<ul>
<% for (const item of page.items) { %>
  <li><%= item %></li>
<% } %>
</ul>
Learn more

HTML

Assign .html extension to the file in order to write page content in HTML.

---
title: About Markdown
description: Markdown is a lightweight markup language with plain text formatting syntax
---

<h2>Subheading of the page</h2>
<p>Here goes paragraph for the subheading</p>
<ul>
  <li>list item1</li>
  <li>list item2</li>
  <li>list item3</li>
</ul>

Draft pages

All page names starting with _ are draft pages, those are only visible or generated only when --draft flag is passed to the server, build or deploy script. Those page will not be accessible otherwise, so you can make a use of those pages and keep them hidden in the production, while you and your team can continue working on it.