echo0282 / blog

The official PhoneGap blog.

Home Page:http://phonegap.com/blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

The official PhoneGap blog.

http://phonegap.com/blog

License:Apache License 2.0


Languages

Language:HTML 99.0%Language:Ruby 0.5%Language:CSS 0.4%Language:CoffeeScript 0.1%