All Projects → welaika → Wp_haml_sass

welaika / Wp_haml_sass

A skeleton for your SASS/Compass/HAML-powered Wordpress themes

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].