Giter VIP home page Giter VIP logo

jekyll-rakefile's Introduction

What it is

A Rakefile to simplify previewing and deploying jekyll websites. Latest version supports Jekyll 1.0.0.

Installation

1. Download this repository
2. Put the files in your jekyll installation
3. Se the variables in _rake_configuration.yml
4. Start using it!

Note. I use two separate files to keep the Rakefile independent of the configuration; it helps when you are managing more than one website with jekyll. However, if you prefer, you can forget about the _rake_configuration.yml file and set the variables directly in the Rakefile.

Main Advantages

The tasks manage URLs for deployment and local preview. This simplifies deployment in a suburi.

More in details: sometime it is difficult to use relative URLs in your Jekyll files (think, e.g., a reference to css files in a layout file used for posts and other pages living at different levels of nesting).

One solution is using the variable {{site.url}}, which can be set in the _config.yml file. By prepending {{site.url}} to the relevant links, URLs are made absolute and are guaranteed to work, no matter where your HTML file will live.

However, using {{site.url}} can break the possibilit of locally previewing your website (e.g. using the jekyll serve command). Consider the case of deploying to a suburi. (Note: it might as well be that I don’t fully understand the deployment/preview options offered by Jekyll, but this is another matter).

The rakefile sets the url variable in the _config.yml using two different settings for local preview and deployment, thus allowing to preview changes locally (url is set to http://localhost:4000) before deploying (the deploy command, in fact, sets the url to the $deploy_url).

Other tasks can simplify your daily life with Jekyll (e.g. creating a post, checking links).

Typical Usage Scenario

rake preview
rake deploy

Commands

The commands made available are:

rake build                           # Build for deployment (but do not deploy)
rake build_static                    # Static build (build using filesystem)
rake check_links                     # Check links for site already running on localhost:4000
rake clean                           # Clean up generated site
rake create_post[post,date,content]  # Create a post
rake deploy                          # Build and deploy to remote server
rake post_changes                    # Create a post with all changes since last deploy
rake preview                         # Preview on local machine (server with --auto)

Caveats

If you do not put the following directive in your _config.yml file:

exclude: ['Rakefile']

the Rakefile will end up in your website. (It shouldn’t do any harm if you publish it.)

License

Distributed under the terms of the MIT License

jekyll-rakefile's People

Contributors

getfol avatar

Watchers

Aaron Ciaghi avatar James Cloos avatar

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.