Browse Source

Custom HAML filter module

- create custom redcloth filter (no hard_breaks)
  - add initializer that requires module
  - rewrite home view with custom filter
alt_logo
jimi 14 years ago
parent
commit
e08d2f1cf4
  1. 46
      app/views/pages/home.html.haml
  2. 1
      config/initializers/custom_haml_filter.rb
  3. 12
      lib/haml/custom_haml_filter.rb

46
app/views/pages/home.html.haml

@ -2,16 +2,31 @@
%script(src='javascripts/jquery.color.min.js') %script(src='javascripts/jquery.color.min.js')
#main #main
:textile
:customtextile
h1. Welcome to Air-one Services h1. Welcome to Air-one Services
This section of the site will contain the most recent article, which will include industry specific content. This content will contain many of the industry specific buzzwords and keywords. Proper use of these keywords will help drive the site to the top of the right search lists.
This section of the site will contain the most recent article, which will
include industry specific content. This content will contain many of the
industry specific buzzwords and keywords. Proper use of these keywords
will help drive the site to the top of the right search lists.
!(left)images/topten.png(Top Ten)! The content over here will generally be the new information that I have researched for you. Here, for example, we would need to go into detail about what the image to the left signifies. Specifically, I need to have more information about what this "Top Ten" logo means.
!(left)images/topten.png(Top Ten)! The content over here will generally be
the new information that I have researched for you. Here, for example, we
would need to go into detail about what the image to the left signifies.
Specifically, I need to have more information about what this "Top Ten"
logo means.
bq. "...key phrases from the main body of content can be displayed to the side" bq. "...key phrases from the main body of content can be displayed to the side"
When the visitor leaves your site with a better understanding of the state or your industry, or an explanation of how and why some work is done, it will only boost their confidence in your abilities to get the job done. Another interesting concept that will be used over here is the "Pull Quote", where key phrases from the main body of content can be displayed to the side. These eye-catching phrases are both visually pleasing and give the reader a quick glimpse of the content included. In addition to their visual appeal, this use of images, bullet lists, and tabular data can entice the site visitor to read the article.
When the visitor leaves your site with a better understanding of the state
or your industry, or an explanation of how and why some work is done, it
will only boost their confidence in your abilities to get the job done.
Another interesting concept that will be used over here is the "Pull
Quote", where key phrases from the main body of content can be displayed to
the side. These eye-catching phrases are both visually pleasing and give
the reader a quick glimpse of the content included. In addition to their
visual appeal, this use of images, bullet lists, and tabular data can
entice the site visitor to read the article.
The following list contains the kind of terms we need to pin down: The following list contains the kind of terms we need to pin down:
* Types of services... like heating, plumbing, electric * Types of services... like heating, plumbing, electric
@ -21,12 +36,23 @@
* Which, if any, products or services are specific to commercial customers * Which, if any, products or services are specific to commercial customers
/ id='main' / id='main'
#sidebar #sidebar
:textile
:customtextile
h1. About Us h1. About Us
Established in 1965, _Air-one Services_ is driven to provide the mid-south region with premium HVAC(Heating, Ventilation, and Air-Conditioning), plumbing and electrical services. In addition, we are one of the area's largest providers of restaurant equipment sales and service.
!(left)images/family.jpg(family)! _Air-one Services_ is a family owned and operated company. This in itself should help ensure you that we will strive to provide you with that personal touch that will leave you feeling comfortable and confident in the work we have done. This personalized service also helps form a relationship between you and our company that will leave you with the confidence that you should bring your future business to us. Our experienced technicians are trained to help provide you with a prompt, professional solution for all your service needs.
Here we can also include detailed information about the origins of the company, and other details that will help interest potential customers.
Established in 1965, _Air-one Services_ is driven to provide the mid-south
region with premium HVAC(Heating, Ventilation, and Air-Conditioning),
plumbing and electrical services. In addition, we are one of the area's
largest providers of restaurant equipment sales and service.
!(left)images/family.jpg(family)! _Air-one Services_ is a family owned and
operated company. This in itself should help ensure you that we will strive
to provide you with that personal touch that will leave you feeling
comfortable and confident in the work we have done. This personalized
service also helps form a relationship between you and our company that
will leave you with the confidence that you should bring your future
business to us. Our experienced technicians are trained to help provide
you with a prompt, professional solution for all your service needs.
Here we can also include detailed information about the origins of the
company, and other details that will help interest potential customers.
/ id='sidebar' / id='sidebar'

1
config/initializers/custom_haml_filter.rb

@ -0,0 +1 @@
require 'haml/custom_haml_filter'

12
lib/haml/custom_haml_filter.rb

@ -0,0 +1,12 @@
module Haml
module Filters
module CustomTextile
include ::Haml::Filters::Base
def render(text)
red_cloth = ::RedCloth.new(text)
red_cloth.hard_breaks = false
red_cloth.to_html
end
end
end
end