Blogging Platform Utilizing Kentico Cloud and Jekyll Static Site Generator
Total Page:16
File Type:pdf, Size:1020Kb
Masaryk University Faculty of Informatics Blogging platform utilizing Kentico Cloud and Jekyll static site generator Master’s Thesis Radoslav Karlík Brno, Fall 2019 Masaryk University Faculty of Informatics Blogging platform utilizing Kentico Cloud and Jekyll static site generator Master’s Thesis Radoslav Karlík Brno, Fall 2019 This is where a copy of the official signed thesis assignment and a copy ofthe Statement of an Author is located in the printed version of the document. Declaration Hereby I declare that this paper is my original authorial work, which I have worked out on my own. All sources, references, and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Radoslav Karlík Advisor: Bruno Rossi, PhD i Acknowledgements This way, I would like to thank my advisor Bruno Rossi for providing valuable feedback while writing this thesis and making sure that the work went in the right direction. iii Abstract This thesis aims to explore the possibilities of integrating the Kentico Cloud with Jekyll static site generator and reveal possible issues of the platform. As a result, there are two implementations. The first implementation is a plugin for the Jekyll framework that generates a website based on content from Kentico Cloud. The second imple- mentation is a sample blogging application using this plugin, that is subscribed to a webhook for content regeneration. iv Keywords Static site generators, Content management systems, Jekyll, Liquid, Kentico Cloud, Site regeneration, CMS integration v Contents 1 Introduction 1 1.1 Background ..........................1 1.2 Problem ............................1 1.3 Contributions .........................2 1.4 Thesis structure ........................2 2 Web applications 5 2.1 History of the Web ......................5 2.1.1 Initial ideas . .5 2.1.2 Web 1.0: Static . .5 2.1.3 Web 2.0: Social . .6 2.1.4 Web 3.0: Semantic . .7 2.2 Web technologies .......................7 2.2.1 Structure . .7 2.2.2 Rendering . .9 2.2.3 Communication . 10 2.2.4 Advanced techniques . 12 2.3 Content management ..................... 13 2.3.1 Headless CMS . 14 2.3.2 Content as a Service . 14 2.4 Types of websites ....................... 15 2.4.1 Static sites . 15 2.4.2 Dynamic sites . 16 3 Rendering on the Web 19 3.1 Evaluation criteria ...................... 19 3.2 Server-side rendering ..................... 21 3.3 Client-side rendering ..................... 22 3.3.1 AJAX widgets . 24 3.3.2 Single page applications (SPA) . 25 3.4 Static rendering ........................ 25 3.4.1 Markup language . 27 3.4.2 Templating engine . 28 3.4.3 Theming . 28 3.4.4 Build process . 28 vii 3.4.5 Hosting . 29 3.4.6 Common use cases . 29 3.4.7 Popular generators . 30 3.4.8 Limitations . 31 4 Platform analysis and design 33 4.1 Current state ......................... 33 4.2 Integration requirements ................... 34 4.3 Existing solutions ....................... 35 4.3.1 Forestry . 35 4.3.2 Contentful . 35 4.3.3 Strapi . 36 4.4 Used technologies ....................... 36 4.4.1 Development dependencies . 36 4.4.2 GitHub Pages . 37 4.4.3 Travis CI . 37 4.4.4 Heroku . 37 4.5 Design ............................. 38 4.5.1 Overview . 38 4.5.2 Build process . 38 4.5.3 Integration options . 39 4.5.4 Generation process . 41 4.5.5 Site regeneration . 42 5 Platform implementation 45 5.1 User configuration ...................... 45 5.1.1 Resolvers . 45 5.1.2 Posts . 46 5.1.3 Pages . 46 5.1.4 Data and taxonomies . 46 5.1.5 Custom files . 46 5.2 Blogging site application ................... 47 5.2.1 Blogging platform requirements . 47 5.2.2 Site description . 47 5.2.3 Site requirements evaluation . 48 5.3 Interesting parts of the implementation ............ 49 5.3.1 Generator plugin . 49 5.3.2 Liquid templates vs. resolvers . 49 viii 5.3.3 Configuration complexity . 49 5.4 Jekyll shortcomings ...................... 50 5.4.1 Lacking documentation . 50 5.4.2 Generator plugin support . 50 5.4.3 Plugins combinations . 51 5.4.4 Flat folder structure . 51 5.4.5 Liquid template data . 51 5.4.6 Cache management . 52 6 Conclusion 53 6.1 Summary ........................... 53 6.2 Future work .......................... 53 A Kentico Cloud 55 A.1 Content modeling ....................... 55 A.1.1 Content elements . 55 A.1.2 Auxiliary elements . 56 A.1.3 Content items . 56 A.2 Collaboration ......................... 56 A.2.1 Workflow . 56 A.2.2 Roles . 57 Index 59 Bibliography 59 ix 1 Introduction 1.1 Background Static websites are still top-rated in the business environment. They offer ease of development, present low security risks, and can generate value rather quickly due to informational content being quite signifi- cant. It helps with building a reputation amongst the target audience and generating new leads [1]. With the rising need for content marketing, dynamic websites became popular as they allow to present actual information. All of this comes at the cost of impacting page loading speed that is also critical [2]. Static site generators (SSGs) aim to solve this issue. SSG is a tool to build a static website from source files. It adds more flexibility to static websites allowing them to react to dynamic content changes, regenerate, and publish again. This concept was created as an alternative to content management sytems (CMS) that manage the creation and modification of digital content. However, statically generated websites can still contain dy- namically generated content on each page load to enhance the user experience. 1.2 Problem A modern CMS is more than just a content repository. It excels at supporting more content consuming channels where the static website generated by the SSG could be only one of them. It also provides tools to manage the whole content life cycle like reviews and collaboration. Currently, not a lot of SSGs support integration with a headless CMS system. This thesis aims to integrate Kentico Cloud as a headless CMS into the Jekyll SSG framework. The goal is to explore the Ruby ecosystem and discover potential problems of using Jekyll together with a headless CMS. Jekyll framework was chosen because of insufficient solutions that would integrate a headless CMS, despite being one of the most popular 1 1. Introduction SSGs [3]. Its presented advantage is that it does not need a CMS, and all content can be written in Markdown and stored in a GitHub repository. 1.3 Contributions This work has two implementation outcomes. The core one is a Jekyll extension in the form of a plugin. The plugin imports content mod- eled in Kentico Cloud, process it based on provided configuration and outputs a ready to publish static website. The second one is a blogging site application used utilizing the developed CMS integration and demonstrating various aspects of the Jekyll plugin. Furthermore, numerous contributions were made to the Delivery Ruby SDK project during this work. It is a layer on top of the Kentico Cloud APIs from where the content is being delivered. Its functionality was also tested through the development of this thesis. The existence of this SDK project significantly simplified the implementation part. 1.4 Thesis structure The thesis is organized as follows: ∙ Chapter 2: presents a history of the web and provides a theo- retical background on web development. The general context of content management will be introduced, and static and dy- namic sites will be defined and compared. ∙ Chapter 3 talks about various approaches for rendering on the web, such as client-side and server-side rendering. Static ren- dering is described in detail at the end. ∙ Chapter 4: gives an overview of the current state and outlines ex- isting solutions. Then it describes used technologies and frame- works used within the integration. Lastly, it shows the design of the integration itself. ∙ Chapter 5: discusses the implementation details of the integra- tion. It starts with presenting options for user customization. 2 1. Introduction Then the blogging site application demonstrating the usage of the integration is presented. Lastly, technical difficulties and non-trivial problems will be outlined, and shortcomings of the Jekyll framework will also be described. ∙ Chapter 6: summaries the work and presents the conclusions. Lastly, it mentions the possible improvements in the future. ∙ Appendix A describes the process of content modeling in Kentico Cloud and its options for collaboration on the content. 3 2 Web applications In this chapter, we will have a brief look at the history of the web. Then we will describe the process of building a website application from the basics such as HTML markup and CSS. We will cover the process of delivering the website’s content from the server until it is displayed on the screen. Then we will look at Content management systems and their evolu- tion. Lastly, we will describe the differences between static and dynamic websites, and their advantages and disadvantages will be evaluated. 2.1 History of the Web 2.1.1 Initial ideas The first description of connecting multiple machines in some inter- acting network was proposed in 1962 by J. C. R. Licklider, a scientist at Massachusetts Institute of Technology (MIT). He had worked on a new aspect of networking called packet-based networking, which eventually matured into a concept known as the Galactic Network. This network was envisioned a globally interconnected set of computers through which everyone could quickly access data and programs from any site. This concept was very much like the Internet is today, but the infrastructure to make it possible did not exist at that time. Later the idea for the first "galactic supernetwork" called ARPANET came out.