decms

Developer-Easy CMS

Usage no npm install needed!

<script type="module">
  import decms from 'https://cdn.skypack.dev/decms';
</script>

README

DEC

Developer-Easy CMS

GitHub package.json version GitHub npm bundle size npm bundle size GitHub All Releases

Very lightweight and simple

If you are a web developer and you want a simple CMS, with no frills and with just what you need, DEC is for you! Write your pages layout using the EJS syntax, one of the simplest HTML templating engines, and everything will just work! You have to be a bit experienced in web development

Features

  • Lightweight, few and small dependencies
  • Simple usage (if you are a developer!)
  • Based on Express and EJS
  • Totally open source (contribute!)

Installation

You can use NPM to install DEC

# Install locally, for one project
npm install decms
# Install globally, system wide
npm install -g decms

Usage

DEC is very simple. You simply run a command, modify the EJS template et voilá! Learn EJS with their official documentation.

To create a new DEC Project, just make a new directory, init a new NPM project, install the decms package and run the following command

dec new 12345 # 12345 is the password to POST new article to the CMS.

The index.ejs file in the root folder of the project will be the root (/) of the site. The article.ejs file will be the template for each article.

In each EJS page will be passed the full articles array, a data object with all the informations about the request and the response and a customData object, that will be equal to the customData.json file, if it exists in the root of the project.

To serve the site use the following command

dec serve

(To serve on a custom port, add a new Environmental Variable in .env, called PORT, and assing to it the number of the port)

Each article URL will be like this: "example.com/article/{article-index}". Article index will be the index of the article in the articles array. To add new articles, make a POST request at this URL: "example.com/post/article", with as body a JSON with the following structure:

{
    "title": "Title of the article",
    "author": "Author of the article",
    "image": "Main image of the article, if it exists",
    "tags": "Tags of the article",
    "body": "Body of the article",
    "password": "Password to POST to the database"
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. There is already a template for pull requests and issues.

Support

For any problem regarding DEC, you can always open an issue! If you want to contact me, feel free to write me at gianlutara@gmail.com

License

MIT