📜 ⬆️ ⬇️

Cogear.JS - modern static site generator

Hi, Habr!


I want to bring to the attention of habrovchan an open source static website generator written in Node.JS , which is based on the 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.


image


The project is aimed at an international audience, so the official website, documentation and video clips are in English.



Special features



For what purposes is suitable:



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:



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:



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 cogear console command.


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" –      

crafting site


Then go to this directory:


 $ cd ~/Sites/site.io 

Launch Cogear.JS in development (development) or production (preparation for production) mode ( more about modes of operation ).


 $ cogear # -     « »     $ cogear production #       —        

Options


You can see the list of command line options by adding the --help flag.


help


useful links


If the topic is of interest to habrovchan, I can make a series of tutorials that yes how.



PS I did not post in I am promoting , because open source.


Ask questions, try to answer.


')

Source: https://habr.com/ru/post/426261/


All Articles