Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A skeleton for your SASS/Compass/HAML-powered Wordpress themes
PHP JavaScript Other
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
init
lib
public
src
.gitignore
Gemfile
Gemfile.lock
Guardfile
README.mdown
Rakefile
ThemeHamlHelpers.php
compass.rb
functions.php
index.php
rsync_exclude.conf
style.css

README.mdown

Wordpress SASS/Compass/HAML theme skeleton

A little introduction

  • src/stylesheets: Put your SASS files here. Will be compiled into public/src;
  • src/views: Put your HAML views here. These are compiled using PHamlP, so check its documentation to know everything about its (little) syntax differences;
  • public/images: Put here all the theme's images. SASS will recognize them properly if you use the image-url() helper;
  • index.php: That's the default WP entrypoint. Call render_view('view_name') to.. well.. render the views you need. You can replicate the same behaviour on single.php, page.php, etc, or you can put everything in index.php and check what's the current page with all the is_XXX() WP functions;
  • helpers.php: Your views should contain less PHP code as possible (that's why HAML makes it so hard to write it). If you need to do something bigger than 3 rows, then refactor it. Transform it into a function and place it in this file. Please, review the lib/helpers.php file in order to see all the helpers this theme already provides you;
  • init/*.php: All the Wordpress initializations must be placed here. A few initializers are already provided: custom_fields.php, custom_post_types.php, hooks.php and site_options.php
  • functions.php: Do not touch this file, unless you need to require a new init/*.php file.

Installation

cd my_wordpress_installation/wp-content/themes
git clone git://github.com/welaika/wp_sass_haml.git my_brand_new_theme
cd my_brand_new_theme
bundle install
bundle exec guard

Now your SASS files are guarded, and will be compiled as soon as you save them.

Something went wrong with that request. Please try again.