-
Notifications
You must be signed in to change notification settings - Fork 9
Managing content on the openSUSE summit website
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 Summit 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)
- First you need ruby to be installed on your machine. Here is the one-click install for it
- 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.
- If you already have git setup on your machine skip to the third topic.
- Here is the one click install to install git and git-core on your machine -
-
Now in order to commit changes to this repo, you need a Github account. So go and create that first ;)
-
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-summit.git
-
What this will do is, it will clone the repository onto your machine. So now you have your working version of the openSUSE summit 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 :)
-
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 runningredcar /path/to/summit/instance
.
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 ;).
- Working directory = the openSUSE-summit (the one you cloned from git) directory where all the code lies. In short the root directory.
cd /path/of/the/root/direcotry
- Images directory =
/static/images/
. So copy/paste the images here. - News directory =
/content/news/2012/
. This is where all the news files are. Existing and newly created ones. - 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.
- Using your console move to your working directory.
- 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 benanoc ci Call-for-papers
;). - 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
- Change the title to the one you would like to have for the page. An example would look like this
title: Call for papers
- 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>
- 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 a news page is pretty much similar to adding page. But with a slight change.
-
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 thisrake create:article title='Call for papers'
-
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
. -
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.
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
- Type
nanoc co
. This will compile the site. Wait a while as this may take some time. - Type
nanoc view
. This will fire up a local server. Open up your browser and browse tolocalhost:3000
. And the site is live there ;).
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.
- Stay in your working directory and do
git add .
- Then commit the changes by doing
git commit -am "A quick summary of what you just did."
- Then push it to the github by doing
git push
That's it you are done pushing to the 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
git fetch
git merge origin/master
That's it you can start editing now.
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 summit-vm
User openSUSE-User name
Port 2206
Hostname summit.opensuse.org
- Then go to your fav console and enter
ssh summit-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/ summit-vm:summit.o.o/
That is it. The site is deployed now.