Cogear.JS - modern static site generator
Hi, Habr!
I want to bring to the attention of habrovchan a generator of static open source sites, written in Node.JS , which is based on Webpack .
The project is inspired by the same Jekyll , but basically uses a modern technological stack. For example, it provides the ability to "hot upload" (without reloading the page) modified scripts and styles.
The project is aimed at an international audience, so the official website, documentation and video clips are in English.
Features
- Modern technological stack
Create modern websites with well-packed (minified, compressed, including gzip) scripts and styles.
You can quickly develop a prototype of the site and slap it on the server.
Use any modern front - end framework (Webpack inside) - Vue.JS , React , Angular , Ember , etc. - Super fast and reliable
Handles ~ 1000 pages per second (depending on page content, as well as processor power).
It's clear that the process of delivering static HTML is much faster than any interpreted language. - Any hosting is suitable.
It does not require a database (information is stored in files) and works on any hosting (since the output is static html-files and assets ). - Built-in deployment
Create a preset and expand the site on the server via FTP, SFTP or evenrsync
.
Recently released material as free zadeploit site now.sh . - Safe. No updates
You can forget about the need for regular updates, as, for example, in the same WordPress.
100% safe, because no one has yet been able to crack static HTML (feature). - Free. Open Source
Use for health. Do not pay a penny.
For what purposes is suitable:
- Rapid prototyping (made a template, showed a working prototype, and then pulled on the engine)
- Portfolio
- The site of the company
- Product site
- Personal blog
Suitable for any site where there is no content generated by the user.
You can even make a collective blog using Pull Requests on Github .
Using Firebase or any other API written in any language (PHP, Ruby, Python, Node.JS) or even using WordPress (JSON-API) and a modern frontend framework such as Vue.JS or React , you can create a dynamic website under more complex tasks: online store, product catalog, and so on.
What is not suitable:
- Forum
- Social network
- Chat
In general, for a project where there is a lot of user-generated content, where a lot of work with the database and pages are generated on the fly.
Requirements
You need to have the Node.JS (9.x or higher) and NPM installed (usually go together).
Download and install (if not already done).
Recommended last (v10.12.0) was verified Node.JS.
With Node.JS <v9.x does not work, because SASS, Less, Stylus is compiled out of the box, and node-sass requires version 9.
You can also use Yarn instead of NPM .
Cogear.JS works on:
- Mac
- Linux
- Windows
You can use the current VSCode for development.
Installation
Simple, without tricks:
$ npm install cogear -g
# or
$ yarn global add cogear
That's all. Installation was successful.
Cogear.JS after installation is available via the console command cogear
.
Now you can generate the first site.
Using
Navigate to the directory where your websites are stored.
$ cd ~/Sites
Call the team to generate a new site:
$ cogear new site.io # где "site.io" – это имя папки нового сайта
Then go to this directory:
$ cd ~/Sites/site.io
Launch Cogear.JS in development
(development) mode or production
(preparation for production) ( more about modes of operation ).
$ cogear # по-умолчанию запускает режим разработки с «горячей подгрузкой» обновленных ассетов и страниц
$ cogear production # построить сайт и запустить локальный сервер — посмотреть как сайт будет выглядеть в продакшне
Options
You can see the list of command line options by adding a flag --help
.
useful links
If the topic is of interest to habrovchan, I can make a series of tutorials that yes how.
- Official site https://cogearjs.org
- Documentation https://cogearjs.org/docs
- Blog https://cogearjs.org/blog
- The https://github.com/codemotion/cogear.js repository
- YouTube tutorials
- List of plugins and themes
PS I did not post in I am promoting , because open source.
Ask questions, try to answer.