{"id":6758,"date":"2016-09-16T13:57:31","date_gmt":"2016-09-16T13:57:31","guid":{"rendered":"https:\/\/itnigblog.live-website.com\/?p=6758"},"modified":"2020-06-11T13:18:44","modified_gmt":"2020-06-11T13:18:44","slug":"fast-simple-and-reliable-jekyll","status":"publish","type":"post","link":"https:\/\/itnig.net\/blog\/fast-simple-and-reliable-jekyll\/","title":{"rendered":"Fast, simple and reliable: Jekyll"},"content":{"rendered":"<p>When we decided we needed to redo the itnig website from scratch we managed to synthesize our needs in three words.<\/p>\n<blockquote>\n<p>Fast, simple and reliable.<\/p>\n<\/blockquote>\n<p>Is there anything faster, simpler and more reliable than static html? Writing a static html page in the dynamic world we live in was out of the question but we needed something that would allow us to do so in an easy way. That\u2019s when we found Jekyll.<\/p>\n<p>Jekyll lets you generate a static html site from dynamic components such as templates, partials, liquid code, markdown, etc.<\/p>\n<h2>Data structure<\/h2>\n<p>Data classes are structured in <strong>Collections<\/strong>, each collection being a folder where each instance is represented by a file. Each one of these files starts with what they call <strong>Front Matter<\/strong> a header where all the instance attributes are defined. This <strong>Front Matter<\/strong> is what allows relationships between classes, filtering, querying, etc.<\/p>\n<p>Classes that don\u2019t need an html page representation are stored using <strong>Data Files<\/strong> (a typical CSV file) instead of being represented by a file in a collection. In our case, we use them to store people working at our startups.<\/p>\n<h2>Data Sourcing<\/h2>\n<p>We could manually create a file in the <em>_jobs<\/em> collection every time we have a new job offer, or a new file in the <em>_events<\/em> collection every time we have a new event, but we love optimising our time, and we already update our job offers on Workable and our events on Meetup, so why not using their APIs? Well that\u2019s exactly what we do. We periodically run a script that retrieves all jobs from Workable creating a file for each one that is then stored in the <em>_jobs<\/em> collection. We do the same for the upcoming events and we also use the Google Drive API to retrieve the latest version of the people CSV file.<\/p>\n<h2>Design<\/h2>\n<p>Once the structure is defined and some data is created you can start working on the design. You can define some properties and attributes on any file using the Front Matter, and obtain and play with your previously created data using Liquid (a templating engine created by Shopify), to finally show it using HTML.<\/p>\n<h2>Conclusions<\/h2>\n<p>After working on and maintaining a Jekyll site for a couple months I can say it meets our expectations, but there are a couple drawbacks you should take into account before jumping into adopting it.<\/p>\n<p>The first one is precisely what makes it fast an reliable, that is, the lack of a backend. Before choosing Jekyll you\u2019ll have to ask yourself if your project is simple enough to avoid user registration and complex class and DB modelling. If it is, go ahead.<\/p>\n<p>The second one is the lack of a \u201cbackoffice\u201d for non-tech people. Whenever we manually update the content of a file (adding for example the video url of an event once it is online) it needs to be synced with the repository using git, and deployed to the server where the site is hosted. This might look simple and clean from the developer\u2019s perspective, but when the content has to be updated by non technical users, this can be a problem. You\u2019ll have to make sure your content manager knows or is willing to learn git.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When we decided we needed to redo the itnig website from scratch we managed to synthesize our needs in three words. Fast, simple and reliable. Is there anything faster, simpler and more reliable than static html? Writing a static html page in the dynamic world we live in was out of the question but we [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":6760,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-6758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts\/6758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/comments?post=6758"}],"version-history":[{"count":4,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts\/6758\/revisions"}],"predecessor-version":[{"id":9224,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/posts\/6758\/revisions\/9224"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/media?parent=6758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/categories?post=6758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnig.net\/blog\/wp-json\/wp\/v2\/tags?post=6758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}