Skip to content

Instantly share code, notes, and snippets.

@BrendanMP
Created January 26, 2017 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrendanMP/e2763a2c4ca23c36e5caaa8a761237f6 to your computer and use it in GitHub Desktop.
Save BrendanMP/e2763a2c4ca23c36e5caaa8a761237f6 to your computer and use it in GitHub Desktop.

#Getting Started with Jekyll Static sites generators FTW

JekyllRb

Why it's awesome

  1. Great docs!
  2. It's fast!
  3. No database!
  4. Gh-pages integration!

Basic Installation

gem install jekyll bundler
jekyll new myBlog
cd myBlog
bundle exec jekyll serve

Now see it in action!

Code Along

  1. Install dependancies.

    • npm i gulp g -g
    • npm i gulp-gh-pages --save-dev
    • gem install jekyll pygments redcarpet bundler
  2. Fork Gulp Sass Browsersync or download zip.

    • Update package.json, _config.yml, index.html with your own info.
  3. CD into project folder and run gulp

  4. Update a Post

    • Navigate to /_posts
    • Update 2014-04-20-welcome-to-jekyll.markdown
    • Save
  5. Create a Post

    • Create new markdown file (.md or .markdown will both work.)
    • Follow the naming convention. YYYY-MM-DD-blog-post-title.md
    • Add front matter.
    • Start writing your new post.
  6. Deployment to Github Pages

    • Add this to snippet to your gulp file
      var deploy = require("gulp-gh-pages");
    
      gulp.task("deploy", ["jekyll-build"], function () {
          return gulp.src("./_site/**/*")
              .pipe(deploy(
                origin: 'https://github.com/User_Name/Your_Git_Remote.git',
                branch: 'master'
              ));
      });
    
    • Run gulp deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment