Skip to content

MoroccanRubyist/moroccanrubyist.github.io

Repository files navigation

Your contribution matters!

Moroccan Rubyist is an open source project and anyone can contribute. We're aiming to get more people to know about Ruby and Rails, and to help the community of Moroccan Ruby developers become bigger, better and more active. Any open source project is only as good as the community behind it. You can contribute by writing tutorials, suggesting ideas, or simply sharing the Website. No matter what your skill level is, every contribution counts.

So you've got an awesome idea about a tutorial. Good! This guide will let you know all the things you need, and help you through the process of making great tutorials for the community.

How this Website works?

Moroccan Rubyist is hosted on GitHub and lives in a public repository that anyone can see and contribute to its code. So the first thing you might want to do is to create a new GitHub account if you don't already have one, and then fork the Website's repository. You can refer back to GitHub Help to learn more about Git and how to work with repositories.

Moroccan Rubyist's GitHub repository

Moroccan Rubyist runs on Jekyll, a static Websites and blogs generator and also the main engine behind GitHub Pages. You can read a bit of Jekyll's documentation in order to have better understanding of how the parts of this Website work. But don't worry, you don't have to read the whole thing to start contributing.

Jekyll's documentation

Writing new posts

Once you're done forking the Website's repository and cloning it to your local machine, you're now ready to start writing new posts. As you might have noticed, the repository contains a directory called "_posts", this is the directory where all posts live. Let's take a look at what's inside a post file!

```html --- layout: post title: Arrays and Hashes in Ruby date: 2014-01-11 06:00:00 author: Youssef Kababe github: YoussefKababe categories: sessions ruby thumbnail: arrays-hashes.png description: Basic data structures tutorial explaining how to use Arrays, Hashes, and some of their useful methods to store and retrieve different types of data. youtube: mRbpUm3lUKg --- ```

You should have known what's this at first glance if you've already read Jekyll's documentation! Yes, it's a YAML front-matter block. It's used to set some post variables that will be rendered by Jekyll into our static HTML pages using the Liquid templating language.

Your posts must always start with a block like the one above, but don't forget to update those variables with your own information! Spend some time making a beautiful 200x200px thumbnail picture for you post, thumbnails are placed in the "/images/thumbnails" directory. You can include one Youtube video in your post. If you don't want that, you should remove the "youtube" variable from the front-matter block.

The rest of your post can be written in either Markdown or Textile, use the one you feel more comfortable with. You may come to some places in your tutorial where you'll want to include some code snippets, you can do this by writing your code between those two Liquid tags:

Liquid syntax highlighting tags

You may also want to include some images, just create a new directory for you post's images inside "/images" directory and drop them all there. Then use your preferred markup language to include them.

Finally, your post's filename must be in a special format so that Jekyll can render it properly. So make sure to name your post like this:

```html YEAR-MONTH-DAY-title.MARKUP

Examples: 2011-12-31-new-years-eve-is-awesome.markdown 2012-09-12-how-to-write-a-blog.textile

<p>
You're good to go now. It's time to start writing your next greatest tutorial!
I'll be waiting for your pull requests :)
</p>