A sandbox rails application that allows you to develop and run your instant website theme locally. It was originally developed by Chamnap Chhorn, and it is currently maintained by him.
It's required you have install ruby and its dependencies correctly. Follow this blog post by Ryan Bigg if you are new to ruby. Basically, this sandbox doesn't require the knowledge of Ruby and Rails.
For the first time, clone this repo
$ git clone git@github.com:yoolk/yoolk_instant_website_sandbox.git
$ cd yoolk_instant_website_sandbox
$ git submodule init
$ git submodule update
Because this repo is new and young, please keep your local repo up to date with new features by the following commands,
$ git pull
$ git submodule update
There is a sample theme inside this repo, which you can browse and see the code.
Then, use Bundler to install the gem and its dependencies:
$ bundle install
Copy the sample attachment files into the sandbox
$ rake instant_website:attachments:copy
You can run this sandbox app by:
$ rails s
Then, go to your browser http://localhost:3000.
-
To switch theme, pass
theme
param. By default, it will pick up the theme fromlisting.instant_website.template_name
. In this sandbox app, it will choosesample
theme otherwise. -
To switch color, pass
color
param. By default, it will pick up the color from 'listing.instant_website.color'. In this sandbox app, it could have one of these twos:blue
orgray
. -
To switch locale, pass
locale
param. By default, it will pick up from current listing's locale. -
To switch listing, pass
alias_id
param. By default, it will pick up from the localhost.json. You can create more listings on your development machine if you like. Just follow the sample schema. -
To switch account, pass
login
param. Have a look on developer@yoolk.com.json.
Yoolk Instant Website Theme is built based on the popular template engine liquid. Check out the theme documentation for details. It is composed of three things:
- Assets: images, javascripts, stylesheets
- Views: templates and layouts
- Locales: locales files if any
To generate theme inside your app:
$ rails g instant_website:theme theme_name
To validate your themes:
$ rake