Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.
/ UnderTasker Public archive

Helping you bootstrap your website or app using a Jekyll, Gulp & Node.js stack

License

Notifications You must be signed in to change notification settings

underlost/UnderTasker

Repository files navigation

Build Status

UnderTasker


I built UnderTasker to help assist in developing and testing websites. More specifically, I wrote it to help develop underlost.net and A Life Well Played, but have since used it for other projects. It’s mainly designed to help generate production ready static assets from their source files, as well as quickly publish sites to Github Pages. Think of it as a sort of swiss army knife for your websites. 

Out of the box, UnderTasker uses the following:

If there’s a Gulp plugin, you can (probably) use it with UnderTasker. Add, remove, and extend to your heart’s content. When you're finished, you can even publish your static site to Github Pages with a single gulp command.

Getting Started

UnderTasker requires Yarn to be installed. Consult the Yarn site for installation directions on your platform.

  • Run yarn install for dependencies (list located in package.json. This might take a little while.
  • Run gulp install to copy over framework dependencies, such as Bootstrap and Font Awesome to your jekyll build.
  • By default, your static assets will be called site.extension (site.css, site.js, etc).
  • If you plan on deploying the site with git, make sure you update gulpfile.js with the correct location.

If Using Jekyll:

  • If necessary, install Jekyll (requires v2.1.x).
  • From the root /undertasker directory, run yarn start in the command line.
  • Visit http://localhost:9005 in your browser.
  • By default, yarn start will use browserSync to run the jekyll build command and reload the page whenever any html changes are detected.

What’s Included

All of your work will mostly be done in the source directory. All files from source will be compiled and copies to the dist directory upon running the specified commands in the next section. Files in the dist directory will be production ready. That is, they will be compiled, minified, and ready to deployed to the web. The compiled dist directory will also be copied to source/site, the directory used for publishing to Github Pages. Gulp will clean up and repopulate files in the dist directories as necessary whenever commands are issued.  

├─ source/
│ ├─ img/
│ ├─ js/
│ ├─ sass/
│ └─ site/
│    └─ dist/
│    └─ index.html
├─ dist/
│ ├─ img/
│ ├─ js/
│ └─ css/
├─ .publish/
│ ├─ dist/
│ └─ index.html
├─ _config.yml
├─ gulpfile.js
├─ Gemfile
├─ yarn.lock
└─ package.json

Just about everything happens in gulpfile.js. If you want to make modifications to the workflow, you’ll probably want to edit that. If you're working with a static site, as previously mentioned, package.json contains several variables you might want to change to better suit the naming conventions of your files.

Bare minimal css elements from Bootstrap (in the form of SCSS) are also included to help you get started. These files are in no way required and can be deleted or edited however you want.

Useful Commands

UnderTasker can do everything at once, or just certain tasks:

  • gulp install Copies over frameworks/dependencies from node_modules. This should typically only ever be used at the start of setting up a project.
  • yarn brew Converts coffeescript files inside source/coffee to source/js/app.js
  • gulp build-css Compiles, autoprefixes, and minifies the CSS. 
  • gulp build-js Minimizes and uglifies everything in the js directory into a single file (including site.js).
  • yarn images Attempts to optimize any JPG/PNG/GIF images in source/img.
  • yarn build Only build all static assets from source, including sass and javascript, as well as tries to optimize any JPG/PNG files in source/img and copies them to dist.
  • yarn github Attempts to build all assets deploys to your project's Github Page.
  • yarn s3 Attempts to build all assets deploys to your project's AWS S3 Bucket (Does not invalidate Cloudfront cache).
  • yarn clean Cleans out (deletes) the dist folders.
  • yarn jekyll Runs jekyll and builds the site into .publish.
  • yarn watch Watches for any CSS/JS/HTML changes, and reloads the browser accordingly.

Usage

UnderTasker can be used for a few different things. If you're looking to use it to develop a static website, you just need to run gulp. UnderTasker users BrowserSync, which allows you to make edits to the CSS, Javascript, and HTML and it will automatically compile and update in the browser for you.

If you're not interested in compiling the HTML, gulp watch will act similar, and update CSS/JS accordingly. If you're looking to use this as a way to build/minify static files to use with your web app, it also has you covered. Just run gulp build and all of your compiled, minified and uglified static files can be found in ./dist.

Example

To see it in action, visit the UnderTasker site. To view the source, or to clone the git repo, check out https://github.com/underlost/UnderTasker. I also built tyler.codes (source) and underlost.net (source) with UnderTasker. I continue to use UnderTasker for various client projects as well.

Support

If you're not sure what this is, it’s probably not for you. UnderTasker is provided as is, and I can not assist in helping you get it setup beyond what's written in these docs. Your best bet is to first go read up on Gulp. If you believe you’ve encountered a bug, feel free to open an issue on Github.

Changes

For updates and changes to this project, please refer to changelog.md.

Roadmap & Features Requests

UnderTasker is built as is, for my use. Feature requests will be considered, but if you'd like to make any changes or add new features, I'd suggest just forking the repo.

That being said, below are some of the updates that I'll be focusing on for future releases:

  • Better AWS support, including invalidating Cloudfront caches.
  • Heroku Support
  • WordPress/CMS integrations. Often times I'll modify UnderTasker to work with WordPress theme development. I'd like to eventually modify the UnderTasker workflow to generate a gulpfile.js and directory structure based on project type.

License

UnderTasker is released under the MIT License.