GithubHelp home page GithubHelp logo

github-for-developers-7's Introduction

jekyll-gulp-boilerplate

A boilerplate project including full setup for Jekyll, GulpJS, SASS, PostCSS, BrowserSync, Autoprefixer and deploy to GitHub Pages using Gulp.

The boilerplate is loaded with Bootstrap and jQuery (via CDN) to get you started with your projects. I have also included some SEO optimizations and Open Graph tags / Twitter Cards tags to tell Facebook and Twitter how shares to your site should display (Note: Look at _includes/metas.html and change accordingly).

System Preparation

To use this starter boilerplate project, you'll need the following things installed on your machine.

  1. Jekyll - $ gem install jekyll
  2. NodeJS - use the installer.
  3. GulpJS - $ npm install -g gulp (mac users may need sudo)
  4. jekyll-minifier - $ gem install jekyll-minifier

Local Installation

  1. Clone this repo, or download it into a directory of your choice.
  2. Inside the directory, run npm install.

Usage

I have two Yaml configuration files: _config.yml and _config.dev.yml that when running in development mode the dev configuration file overrides baseurl and jekyll-minifier default values.

Development Mode

Running development mode will not minify your HTML or Javascript.

Also if you are deploying to GitHub Pages - Project Pages, overriding the baseurl to empty ("") is essential to display the website correctly in localhost.

$ NODE_ENV=dev gulp

Jekyll

As this is just a Jekyll project, you can use any of the commands listed in their docs

Deploy with Gulp to GitHub Pages (Production Mode)

To accomplish this I am using gulp-gh-pages and the final site will have HTML, CSS and Javascript minified.

In a nutshell, you need to have your project in GitHub and deploy to to a gh-pages branch. Then to deploy just run

$ NODE_ENV=prod gulp deploy

or simply

$ gulp deploy

Something to note is that in the gulp deploy task gulp.src() needs to be the path to your final site folder, which by default will be _site. If you change the destination in your _config.yml file, be sure to reflect that in your gulpfile.

Getting Your Branch Prepared

$ git init
$ git add .
$ git commit -m 'First Commit'
$ git remote add origin [email protected]:username/repository-name.git
$ git push -u origin master
$ git checkout --orphan gh-pages
$ git rm -rf .
$ touch README.md
$ git add README.md
$ git commit -m "Init gh-pages"
$ git push --set-upstream origin gh-pages
$ git checkout master

And finally you can deploy to GitHub Pages

$ gulp deploy

After deploying run the Gulp clean task since while deploying gulp-gh-pages creates a .publish directory with your entire site, and in my opinion it just a waste of hard disk space to leave it alone.

$ gulp clean

or simply Right Click -> Delete that direcotry to delete it.

Screenshots

This is how the boilerplate template looks like.

JPG

And here's a GIF showing the CSS injecting.

GIF

Credits

This boilerplate was built upon shakyShane starter project.

Miscellaneous

More information on Twitter Cards.

Twitter Cards validator tool lets you preview your card.

Facebook Sharing Debugger lets you preview your Open Graph tags.

github-for-developers-7's People

Contributors

peterbell avatar

Watchers

 avatar  avatar  avatar

github-for-developers-7's Issues

Add bios to project

We should all create great bios in this project. Make sure your bio includes:

     - [ ] Your name
     - [ ] Where you are from
     - [ ] A favorite food
     - [ ] A hobby

Class goals

Please tell us one thing you would like to learn in today's class!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.