Git Product home page Git Product logo

blog's Introduction

This is a fairly vanilla Jekyll/GitHub Pages site. It has been optimized for improved page loading speed; see this article for a full description.

Setup

Install rvm to manage Ruby versions:

$ \curl -sSL https://get.rvm.io | bash -s stable

Install Ruby:

$ rvm install 2.1.5
$ rvm use 2.1.5 --default
$ ruby -v
ruby 2.1.5

Install the Ruby Bundler:

$ gem install bundler

Clone this repository:

$ git clone https://github.com/phonegap/blog.git
$ cd blog/

Install the Ruby dependencies for phonegap.com:

$ bundle install

Running Locally

Build and watch everything except the blog:

$ rake watch

Then open a browser to http://localhost:4000/blog/.

Build and watch everything including the blog:

$ jekyll serve --incremental

Then open a browser to http://localhost:4000/blog/.

Writing Blog Posts

  • To write a post, commit a markdown file to the _posts/blog/ directory.
  • You can use the post template as a starting point.
    • Optionally you can also use a Rake task to create the new post file locally. Install Ruby and Rake as mentioned above in the "Setup" section. Run $ rake post["Put the Post Title Here"]
  • Name the file with the date first, followed by a url friendly version of the title. Example: 2016-02-24-phonegap-desktop-app-0.2.2.md
  • Tag pages have to be set up manually; do your best to use existing ones, if you need to set up a new one, setup a new tag page in the /blog/tags using the tag template
  • Use markdown for simple formatting. It is converted to html using Kramdown
  • HTML is also acceptable, just use the .html extension on the filename.
  • To keep videos and images responsive please don't add the width property. If images are too large you can add the max-width style: <img src="/blog/uploads/2016-02/Browser.jpg" alt="Browser" style="max-width: 400px;"/>
  • To include images, add them to /uploads/[4 digit year]-[2 digit month]. If the directory you need for the month isn't there, feel free to add it. To include the image in the post just use the same directory structure: ![Browser](/blog/uploads/2016-02/Browser.jpg).
  • Kramdown is using GitHub Flavored Markdown. The easiest way to add code snippets is to using triple backticks; you can also define the language for better syntax highlighting. For a full list of languages here.
  • You can preview the post locally using the setup and commands mentioned above in the Setup section.
  • If you have write access to this repo and you feel comfortable with the blog post, feel free to commit to master.
  • If you don't have write access to this repo, or you would like a review, please make a pull-request.

Test Locally

The site is using Travis CI and HTML Proofer to check the html and referenced urls. Before you make a pull request it's a good idea to run the tests locally first.

Just run the command:

$ rake test

The output should be something like:

Running ["ScriptCheck", "LinkCheck", "ImageCheck"] checks on ./_site on *.html...


Checking 7 external links...
Ran on 3 files!


HTML-Proofer finished successfully.

If it finds any errors be sure to fix them before making the pull-request.

blog's People

Contributors

garthdb avatar jenlgray avatar hermwong avatar devgeeks avatar timkim avatar goya avatar

Watchers

James Cloos avatar Rozman 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.