Improved Jekyll Build Script... Using Bash

18 Jan 2018

I’ve written about my Jekyll build script before. I use this script to deploy this site among others. It is terribly over-engineered and unnecessary.

Here is the new and improved version. Instructions for use are below the code itself.

  • JS Minification
  • JS Babel Compiler
  • HTML Minification
  • CSS Minification
  • Thumbnail Generation
  • Intelligent Image Compression
  • Favicon Generation
  • Jekyll Build Process
  • Automatic Upload to S3
  • Setup Mode (Installs Dependencies)
  • Sane Image Names (jpeg, JPG, etc to jpg)
How to Use

Copy the script into a new text file and save the file in the root of your Jekyll directory as

Make sure to set up the options under # BUILD OPTIONS - EDIT THESE in

Install dependencies by running sh -s. Requires homebrew.

Then, run the build script by running sh -c.

Sample Build Output
daviseford$ sh -c
Generated 126 thumbnails (1 new) in ./public/img/thumbnails/
Now running -o7 level compression on 1 .png files in ./public/img/
Finished image tasks
Configuration file: /Users/davisford/Documents/daviseford-jeykll/_config.yml
            Source: /Users/davisford/Documents/daviseford-jeykll
       Destination: /Users/davisford/Documents/daviseford-jeykll/_site
 Incremental build: disabled. Enable with --incremental
         AutoPages: Disabled/Not configured in site.config.
        Pagination: Complete, processed 1 pagination page(s)
                    done in 3.856 seconds.
 Auto-regeneration: disabled. Use --watch to enable.
Babelified JS
Minified JS
Minified CSS
Minified HTML
upload: _site/public/img/misc/aws_cert/AWS_Certified_Logo.png to s3://daviseford-website-code/blog/public/img/misc/aws_cert/AWS_Certified_Logo.png
upload: _site/public/img/thumbnails/misc/aws_cert/AWS_Certified_Logo.png to s3://daviseford-website-code/blog/public/img/thumbnails/misc/aws_cert/AWS_Certified_Logo.png
Uploaded to S3
Created build_log.txt

Any problems, just email me.