Skyline as plugin

Warning

For these instructions we're assuming you have a working development environment with MySQL, Git and all the required gems which you can find in the Skyline CMS Gemfile.

You can also let Bundler handle all your gem dependencies. To do so follow this guide in our Articles section.

These instructions have been tested on Fedora 10 and OSX with mac ports.

Create your Rails application

$ rails <app_name> --database=mysql

Setup Git repository

$ cd <app_name>
$ git init

Create .gitignore

.DS_Store
log/*
tmp/*
config/database.yml
public/skyline
_Store
Thumbs.db
bin

Add skyline to your project

$ git submodule add git://github.com/DigitPaint/skyline.git vendor/plugins/skyline
$ git submodule init
using Bundler?

If you followed our bundler setup guide you should add the following lines to your Gemfile:

skyline_gemfile = File.join(File.dirname(__FILE__), 'vendor', 'plugins', 'skyline', 'Gemfile')
instance_eval(File.read(skyline_gemfile), skyline_gemfile)

Setup database

Setup your database.yml to match your database configuration.

Then run:

$ rake db:create
$ rake skyline:db:migrate
$ rake skyline:db:seed

Create user and grant rights

$ ./script/console
>> u = Skyline::User.new
>> u.email = 'admin@admin.com'
>> u.password = 'secret'
>> u.roles << Skyline::Role.first
>> u.save!

Create Skyline configuration file

$ vi config/initializers/skyline_configuration.rb

Add the following lines:

Skyline::Configuration.configure do |config|  
  config.assets_path = File.join(Rails.root,"tmp/upload")
  config.media_file_cache_path = File.join(Rails.root,"tmp/cache/media_files/cache")
  config.rss_section_cache_path = File.join(Rails.root,"tmp/cache/rss_sections/cache")   
end

Create template folder

$ mkdir app/templates

Setup routes

Add the following line to config/routes.rb

map.connect '*url', :controller => "skyline/site/pages", :action => "show"  

Templates

We've prepared a set of default templates here to make sure your website shows up nicely.

So all you have to do is copy the files into the proper folders and you're ready to go.

Make sure to read our templating guides to get a better understanding of how templates work in Skyline.

Optional: environment.rb

To avoid having to restart the server each time you make a change to Skyline add the next lines to your environment.rb:

config.reload_plugins = true if RAILS_ENV == "development"