Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.

How to's

shayonj edited this page May 25, 2012 · 1 revision

This guide will walk you through the below points

  • Install nanoc on openSUSE 12.1
  • Setting up git (basics)
  • Adding/Editing content to the openSUSE Conference website

Please note : This guide assumes that you are running openSUSE 12.1 currently. If you happen to come across any errors/issues, contact Shayon/Sj (IRC nick : shayonj)


Install nanoc on openSUSE 12.1

  1. First you need ruby to be installed on your machine. Here is the one-click install for it
  1. To install nanoc, bundler(to update/install the gem file) and adsf (local server to view the website), go to your fav console and run the below the commands
  • gem install nanoc
  • gem install bundler
  • gem install adsf

That's it, you are done with the first part here.

Setting up git (basics)

  1. If you already have git setup on your machine skip to the third topic.
  2. Here is the one click install to install git and git-core on your machine -
3. Till here you are done installing git on your machine. Follow the guide [here](http://help.github.com/linux-set-up-git/) (from Topic:Set Up SSH Keys ), to setup your ssh keys.
  1. Now in order to commit changes to this repo, you need a Github account. So go and create that first ;)

  2. Then go to your fav console, move (using cd) to your working directory (if any) and then paste this in your console git clone git@github.com:shayonj/openSUSE-Conference.git

  3. What this will do is, it will clone the repository onto your machine. So now you have your working version of the openSUSE Conference website. If you are not able to clone it, send me (shayon/sj) your username and I will collaborate the repo with you. And now you are almost ready to start adding/editing contents :)

  4. At this point it will be a good idea to have a text editor ready on your machine. Because you will very much need it in order to edit the files. I use Redcar. You can install it by running gem install redcar from your console. To use it do the same by running redcar /path/to/Conference/instance .

Adding/Editing content to the openSUSE Conference website

Before I start, let me tell you its all basic HTML. You may see a bunch of ruby code around. You can leave it as it is. I have mentioned below on parts you will be needing to edit. That will make life easier for everyone ;)

Also please note the following terms before I begin. They will come handy and I wont be repeating the same things as I go along ;).

  1. Working directory = the openSUSE-Conference (the one you cloned from git) directory where all the code lies. In short the root directory. cd /path/of/the/root/direcotry
  2. Images directory = /static/images/ . So copy/paste the images here.
  3. News directory = /content/news/2012/ . This is where all the news files are. Existing and newly created ones.
  4. Pages directory = /content/. All the pages lie here. The existing ones and the newly create ones.

IMPORTANT NOTE : Before you start editing or adding content. Please scroll down and read the "Fetching from git" part from the topic " Committing to git and fetching from git " . If you have just cloned the repo then its fine. But if you are returning after a while or a day or two it is a good idea to pull all the information first from the repo and then start editing.

How to create basic pages in the openSUSE Conference instance.

  1. Using your console move to your working directory.
  2. Type nanoc ci Page-Name . Note : If the page name is more than one word then replace spaces with "-". So for example, you need to add a page "Call for papers", your command should be ? Think think .. Well it should be nanoc ci Call-for-papers ;).
  3. That's it you have now created the page. Go to your favorite text editor -> Pages directory and you will find the Page-name.html created there.

Quick note :Don't remove anything from the file

Adding some text/image to a basic page

  1. Change the title to the one you would like to have for the page. An example would look like this

title: Call for papers

  1. Adding text/image here is really simple. Its all HTML. I have a sample code below to get you started.

<h2>Title</h2> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <img src="/images/imaage-file.png" alt="This is an image" /> <h3>Title 1</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>

  1. Like you saw its all basic html. If you happen to use an image, first copy the image in the image directory and then adjust the img src syntax. You should be all set then.

Adding news content to the website

  1. Adding a news page is pretty much similar to adding page. But with a slight change.

  2. Using console (and I am assuming you are in working directory), type in the command rake create:article title='Title for the news' . An example would look like this rake create:article title='Call for papers'

  3. That's it, now move to your news directory look for the appropriate .html file with the present day's date as the prefix. An example file would look like this 03-12-call-for-papers .

  4. You can start adding content to this page that same way you would do for a basic page. But please note

  • Don't change any of the pre-generated data on the page. Start working below it.
  • Once you are done with adding text. You will find excerpt in the pre-generated text. You need to add some text in there as this is what will be shown on the front-page. But make sure you put the data in between the inverted commas "" . For example

excerpt: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" Header and paragraph html tags should be avoided here.

Viewing the progress on your local machine

Its difficult to proceed (at least for me it is) without having a look at the progress you are making or how of mess you are creating around ;). So in order to that go to console, stay in your working directory

  1. Type nanoc co . This will compile the site. Wait a while as this may take some time.
  2. Type nanoc view. This will fire up a local server. Open up your browser and browse to localhost:3000. And the site is live there ;).

Committing to git and fetching from git

Committing to git.

Once you are done with adding all sorts of content to the website. Here is what you will need to do in order to commit the changes to git.

  1. Stay in your working directory and do git add .
  2. Then commit the changes by doing git commit -am "A quick summary of what you just did."
  3. Then push it to the github by doing git push

That's it you are done pushing to the git.

Fetching from git.

Now here is an important part, please read it carefully . Since there are multiple editors to this site, you may never know when a content is added or deleted so before you are start editing it will be good to pull the content (if any) from the repo first. You can do that by

  1. git fetch
  2. git merge origin/master

That's it you can start editing now.

Deploying the site to the Conference instance.

In order to deploy the site, submit the aboev information as described to darix. Then once things are taken care of by him, here is what you need to do .

  • add this to your ~/.ssh/config (you can use gedit)

Host Conference-vm

User openSUSE-User name

Port 2206

Hostname Conference.opensuse.org

  • Then go to your fav console and enter ssh Conference-vm to see if you can log in or not. or play around stuff ;).
  • And then to deploy, browse to your working directory and type rsync -e ssh -avz output/ Conference-vm:Conference.o.o/

That is it. The site is deployed now.