A JavaScript CMS on the server
Replacing PHP by JavaScript, part 2: Reviving Wordpress in JavaScript, example with the Ghost CMS.
I finished the first part of this article, Why JavaScript on the server, (to replace PHP) with the conclusion that the LAMP model was not suitable for modern applications, among other reason, due to the lack of an offline mode, not allowed with PHP. Wordpress is the best example. Even if this CMS has many qualities and many advantages over its competitors, notably the ease of use and customization, it is less and less suitable on modern platforms, because of its LAMP background.
As I suggest in this article, new CMS based on JavaScript and Node.js begin to appear. An example with Ghost. This CMS obtained a consequent fundraiser on KickStarter with the support of several companies, including Microsoft, which has invested ($ 50,000 is reported) to support its development.
And the terms of the presentation of the software agree well with my own conclusions:
At Ghost, we feel that not only does the use of JavaScript provide us access to rapidly growing communities of bright minds, but it also makes the project accessible to other communities that have no interest in the PHP projects, which are now old guard. JavaScript has stood the test of time and Ghost, true to its mission, is able to work closely with the communities that push innovation forward on the web.
Apparently many of the comments on the first part, especially on Hacker News, come from the old guard ;)
It remains to show more precisely how the use of JavaScript allows for a more modern CMS.
Personal Dashboard
Wordpress uses widgets to allow the webmaster to make the interface of the site, and it is also possible with a JavaScript CMS. But Ghost goes further, you can also build your own dashboard by adding and moving widgets...
The dashboard is built as a web or mobile application: it fits in a single page while Wordpress uses principles of desktop applications inherited from legacy with a multitude of tab each dedicated to one of the management task of the site.
Edition unconstrained
The creation of a post makes use of two panels: on the left, the "source code", which is not in HTML but markdown instead. And on the right content as seen by the reader.
This choice is justified by the desire to build a simple CMS, limited to blogging, what was Wordpress at the origin. This reduces formatting problems. It is often difficulty to get what we want with the WordPress editor (TinyMCE) because it has its own rules and removes the tags that are inserted when it does not suit it. This is something that is inherent in all these online editors which do not have the capacity of DreamWeaver of synchronization between the source and the display. The markdown has limitations, but its simplicity provides the synchronization to write a post more comfortably.
Access to prior articles and editing them in Ghost is also facilitated by a double window. A list can be scrolled in a window to select a post and to edit it. It is easy to switch from one to another. Wordpress due to its old design, requires moving from one page to another for the same tasks which makes editing more difficult.
Themes and plugins without templates
Making a theme in JavaScript and HTML seems easier than with PHP, and plugins too. A theme here is an HTML and CSS page, with fields dedicated to each part of content. A plugin is a JavaScript file that is loaded into the page or is added as a module to Node.js.
There is no reason to meet these compatibility issues with both other plugins and with new versions of the software, which fulfill Wordpress forums of complaints. Once the software has a modern design based on WebSocket like Advanced Explorer on this site, modules can communicate through messages and the same controls receiving the same answers, different modules can evolve independently without inconvenience .
Running on mobile
The advantage of JavaScript and Node.js is to allow Ghost to run on all devices as an application because it is faster and lighter than Wordpress. The author has access to the dashboard on a tablet or mobile .
It is obvious that removing just that 1300 KB of the TinyMCE editor and 500 KB of jQuery, it significantly speeds up the loading of the dashboard! In fact, the JavaScript directory of Wordpress 2.9 contains more than 3 megas of code.
To access the dashboard on a mobile, we should at least has the offline mode to store all the necessary code locally. But this is not possible with a software written in PHP .
All shared hosting do not support Node.js. But there are such as Gandi. And there is the cloud.
Documents: PHP a fractal of bad design. "PHP was written for non-programmers ... and non-programs".
See also: Wordpress will ditch PHP for JavaScript.