<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dave 🧱</title>
    <description>The latest articles on DEV Community by Dave 🧱 (@daviddarnes).</description>
    <link>https://dev.to/daviddarnes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F441639%2Ff71845ca-6e13-4066-b428-ed529d59e403.jpg</url>
      <title>DEV Community: Dave 🧱</title>
      <link>https://dev.to/daviddarnes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/daviddarnes"/>
    <language>en</language>
    <item>
      <title>Jekyll alternatives: The benefits to JavaScript static site generators</title>
      <dc:creator>Dave 🧱</dc:creator>
      <pubDate>Wed, 20 Jan 2021 15:53:27 +0000</pubDate>
      <link>https://dev.to/takeshape/jekyll-alternatives-the-benefits-to-javascript-static-site-generators-9l9</link>
      <guid>https://dev.to/takeshape/jekyll-alternatives-the-benefits-to-javascript-static-site-generators-9l9</guid>
      <description>&lt;h3&gt;
  
  
  Jekyll paved the way for an entire ecosystem of static site generators to flourish, but what do these new JavaScript SSGs offer over Jekyll? Let’s find out!
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F41mqzg6p0ne8wq9wsnl7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F41mqzg6p0ne8wq9wsnl7.png" alt="Jekyll logo" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What’s wrong with Jekyll?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Hey! Whoa there, I’m not about to start hating on &lt;a href="https://jekyllrb.com/" rel="noopener noreferrer"&gt;Jekyll&lt;/a&gt;, here! I’ve got a real soft spot for that classic SSG - it’s what got me into the &lt;a href="https://jamstack.org/what-is-jamstack/" rel="noopener noreferrer"&gt;Jamstack&lt;/a&gt; in the first place. However, a lot has happened since that first commit &lt;a href="https://en.wikipedia.org/wiki/Jekyll_(software)" rel="noopener noreferrer"&gt;back in October 2008&lt;/a&gt;, and the landscape has grown plenty enough to find out if there are greener pastures elsewhere for us.&lt;/p&gt;

&lt;p&gt;If you’re someone with a long-standing Jekyll site somewhere, think of this article as the lightest of toe dips into the land of JavaScript based static site generators. We’re going to take a look at some alternatives and the benefits we can gain from using JavaScript to build our Jamstack.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Variety in choice&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Comparing Jekyll directly to JavaScript isn’t a good idea, and very much “comparing apples to oranges”. Instead, let’s take a look at some of the wide variety of static site generators that are built on top of JavaScript:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fljrbbicnpgi77lr8b5pc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fljrbbicnpgi77lr8b5pc.png" alt="Eleventy Logo" width="800" height="623"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.11ty.dev/" rel="noopener noreferrer"&gt;Eleventy&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Eleventy, or 11ty, is a wonderful SSG that has a lot in common with Jekyll. Liquid templating, Markdown source files, data files and other features are all here with many more for you to utilise. I’ve been using Eleventy a lot and I’m really enjoying it, which I think is due to how similar it feels to Jekyll, while still giving me that vanilla JavaScript power.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3fk6l5p4gjela69fzbo4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3fk6l5p4gjela69fzbo4.png" alt="Next.js Logo" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;If you’ve been tempted by &lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;React&lt;/a&gt; and want to use it to build out components, then maybe Next.js is more your bag &lt;del&gt;for generating your site&lt;/del&gt;. Next.js is an open source project created by the team at Vercel, which is an ideal platform to host your Next.js site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdoro3rixvopgbns1c5ja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdoro3rixvopgbns1c5ja.png" alt="Gatsby Logo" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.gatsbyjs.com/" rel="noopener noreferrer"&gt;Gatsby.js&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Gatsby is another static site generator based on React that has a large ecosystem of plugins and documentation. I’d recommend &lt;a href="https://www.gatsbyjs.com/" rel="noopener noreferrer"&gt;checking out their official site&lt;/a&gt; to see if the features suit your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8qgr3axmys76zywotnb1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8qgr3axmys76zywotnb1.png" alt="Nuxt Logo" width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://nuxtjs.org/" rel="noopener noreferrer"&gt;Nuxt.js&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;No, that’s not a typo - it’s really called Nuxt.js. For those unfamiliar with the framework landscape, &lt;a href="https://vuejs.org/" rel="noopener noreferrer"&gt;Vue&lt;/a&gt; is a JavaScript framework that sits in the same space as React. With Nuxt.js, you get all the features you need to create a Jamstack site, but with Vue as the core engine. I’ve used Nuxt.js, and despite my usage being brief, I had a good time writing out components and handling data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbvnrfydm9zxitccubt46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbvnrfydm9zxitccubt46.png" alt="Gridsome Logo" width="800" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://gridsome.org/" rel="noopener noreferrer"&gt;Gridsome&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Gridsome is another SSG with Vue at its core, but with an ecosystem more akin to Gatsby. Vue is quite an approachable framework: creating a component has similarities to writing regular HTML. Check out both the &lt;a href="https://vuejs.org/v2/guide/" rel="noopener noreferrer"&gt;Vue docs&lt;/a&gt; and &lt;a href="https://gridsome.org/docs/" rel="noopener noreferrer"&gt;Gridsome docs&lt;/a&gt; to see if it’s a fit for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjzpqp138vgvjk52riakk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjzpqp138vgvjk52riakk.png" alt="Scully logo" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://scully.io/" rel="noopener noreferrer"&gt;Scully&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The SSGs listed above are some of the most popular out there, so I thought I’d mention Scully to show something a bit different. Scully is based on &lt;a href="https://angular.io/" rel="noopener noreferrer"&gt;Angular&lt;/a&gt;, a long standing JavaScript framework from Google. From what I’ve seen, Angular isn’t as widely used as React or Vue, but if you’ve had some good exposure to it on other projects, Scully might be just what you’re looking for.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Control over configuration&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you’ve used Jekyll as much as I have, you’ll know that it kind of has a strict configuration to it. It’s original focus was blogging, and the method of adding a blog post meant creating files with &lt;a href="https://jekyllrb.com/docs/structure/" rel="noopener noreferrer"&gt;particular names and putting them in particular folders&lt;/a&gt;. It was a similar case when adding a config and collections.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fam5wisx94bsd0r1zetdz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fam5wisx94bsd0r1zetdz.png" alt="Jekyll posts config" width="704" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot for the official Jekyll documentation, on how you need to name your posts in a particular manner for them to work as expected&lt;/p&gt;

&lt;p&gt;With these new JavaScript-based SSGs, you have much more of an open playing field to create your own structures, and configure them to your particular needs and preferences, for example: in an Eleventy project, you can name and organise your files however you wish, then &lt;a href="https://www.11ty.dev/docs/collections/" rel="noopener noreferrer"&gt;configure Eleventy to express those files as a list of blog posts&lt;/a&gt;. Heck, you don’t even have to use files for your blog posts…more on that later.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;It’s JavaScript&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I’ll admit, early in my career, I found JavaScript a bit daunting. It felt so exotic when comparing it to HTML and CSS syntax, which is probably why I warmed to tools like Jekyll to build out my web projects. However, JavaScript is an extremely ubiquitous language, with a vast array of &lt;a href="https://github.com/micromata/awesome-javascript-learning" rel="noopener noreferrer"&gt;resources surrounding it&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With that ubiquity comes a lot of people with pre-existing knowledge. If your team already knows a good amount of JavaScript, it’s going to be a big deciding factor for your next project.&lt;/p&gt;

&lt;p&gt;You can write regular, or vanilla, JavaScript right alongside your framework specific code using any of the SSGs mentioned above, for example: I could be writing React components in a Next.js project and switch to ES6 JavaScript in the same file.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;APIs and GraphQL at your fingertips&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Okay, so this for me is the biggest game changer when going with a JavaScript based SSG over Jekyll. With Jekyll, your content has to be in a markdown file; yes, there are ways around this, but you’re going to have a bumpy ride doing it.&lt;/p&gt;

&lt;p&gt;Publishing tools have come a long way and we should be utilising the best tools for the job - the best way to do that is with APIs. Rather than a markdown file, we can use services like &lt;a href="https://www.takeshape.io/articles/building-a-rich-e-commerce-experience-on-the-jamstack-with-takeshape-shopify-and-next-js/" rel="noopener noreferrer"&gt;Shopify&lt;/a&gt; for store products or &lt;a href="https://www.takeshape.io/" rel="noopener noreferrer"&gt;TakeShape&lt;/a&gt; for our pages and posts, which can then be fed straight into our JavaScript SSG project. We can even use those sources all together, which is what the Jamstack is all about: bringing the best tools together to produce a content rich website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0xk244ix8mmtwaorq6sx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F0xk244ix8mmtwaorq6sx.png" alt="GraphQL Query" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example of TakeShape's GraphQL query language&lt;/p&gt;

&lt;p&gt;With &lt;a href="https://www.takeshape.io/" rel="noopener noreferrer"&gt;TakeShape&lt;/a&gt;, not only can you produce &lt;a href="https://www.takeshape.io/content-editor/" rel="noopener noreferrer"&gt;your own custom CMS with it’s own API&lt;/a&gt;, but you can bring in multiple API resources to create a single endpoint to access all your data. Shopify, &lt;a href="https://www.contentful.com/" rel="noopener noreferrer"&gt;Contentful&lt;/a&gt;, &lt;a href="https://analytics.google.com/analytics/web/" rel="noopener noreferrer"&gt;Google Analytics&lt;/a&gt; and more can be used with &lt;a href="https://www.takeshape.io/mesh/" rel="noopener noreferrer"&gt;Mesh&lt;/a&gt; - a single backend that can be accessed with a single GraphQL API.&lt;/p&gt;

&lt;p&gt;GraphQL is a language for interacting with APIs and comes built into TakeShape. It can also be used with any of the static site generators mentioned above. &lt;a href="https://www.takeshape.io/mesh/" rel="noopener noreferrer"&gt;Take a look at the Mesh feature page&lt;/a&gt;, as well as the official &lt;a href="https://graphql.org/learn/" rel="noopener noreferrer"&gt;GraphQL docs&lt;/a&gt; for more information.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Build times&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I find it hard to compare build times between SSGs, as they all perform differently with unique levels of complexity and content sizes. From what I’ve seen, my Jekyll projects range from 2 to 10 minutes for a build to complete. If you’re experiencing similar build times, I would consider checking out the alternatives listed higher up in this article and see what might fit your content structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftj4u18vlcsq3ftv2607c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftj4u18vlcsq3ftv2607c.png" alt="Build Times" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Screenshot for from Sean's article, showing graphs they made for the article research&lt;/p&gt;

&lt;p&gt;Sean C Davies does an excellent job of examining and comparing build times of the most commonly used SSGs in &lt;a href="https://css-tricks.com/comparing-static-site-generator-build-times/" rel="noopener noreferrer"&gt;this research article&lt;/a&gt;. You’ll see that results show Jekyll does quite well in most cases, but Eleventy beats it for build times with large amounts of content - the other JavaScript SSGs do begin to catch up with the latter as the file count increases.&lt;/p&gt;

&lt;p&gt;Again, it’s best to do a little research into these SSGs to see which will fit the content structure and feature set you’re aiming for. Which brings me nicely onto…&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Use what’s best for the job&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Bet you’re thinking I’ve cop’d out of this one, and pulled out the classic “It depends™️” for the article's conclusion. That’s certainly not the case; everything I’ve mentioned is valid and should be taken into consideration if you’re thinking of switching from Jekyll in an existing project, or if you’re wanting to switch up your typical stack.&lt;/p&gt;

&lt;p&gt;Jekyll is a great tool, but there are limitations that prevent it from really excelling, especially in client projects. It’s hard to use with an API, its’ configuration is quite specific, and it can be hard to make it flex to different project types.&lt;/p&gt;

&lt;p&gt;But let’s not leave it there! What do you think? Has this article made you consider Eleventy or Next.js more than before, or is Jekyll still pulling at your heartstrings? &lt;a href="https://twitter.com/takeshapeio" rel="noopener noreferrer"&gt;Tweet at @TakeShape on Twitter&lt;/a&gt; - we’d love to hear what you have to say 🐦&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>gatsby</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
