I would like to use Haml for pages (and possibly templates) and Sass for CSS. But I am a webgen newbie and can''t figure out the configuration. Is such a configuration possible? Could someone help me set it up?
> I would like to use Haml for pages (and possibly templates) and Sass > for CSS. But I am a webgen newbie and can''t figure out the > configuration. Is such a configuration possible? Could someone help me > set it up?You need to put the following into your config.yaml file: default_processing_pipeline: Page: haml,fragments Normally, the processing pipeline also includes erb, tags and blocks tags, but I think they are not needed when using haml since haml includes facilities to execute ruby commands (and tag results can still be used through the context object as well as block rendering). If you need to change the default for template files, just add another entry with Template as key instead of Page. If you want to use sass for your CSS files, just name them something like default.sass.css. This will tell the copy handler that sass should be run on the content before writing it to the output path. If you need further help, don''t hesitate to write again! Best regars, Thomas
Thank you for your help! I think I''m getting the hang of it now. Just for future reference, this is a bare bones setup: config.yaml ==========default_processing_pipeline: Page: haml,fragments Template: haml,fragments default.template ===============!!! XML !!! 1.1 %head %link{:rel => "stylesheet", :type => "text/css", :href => "default.css"} %title= context.node["title"] %body = context.render_block("content") index.page =========--- title: A page --- %h1 A heading The resulting index.html =======================<?xml version=''1.0'' encoding=''utf-8'' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/ TR/xhtml11/DTD/xhtml11.dtd"> <head> <link href=''default.css'' rel=''stylesheet'' type=''text/css'' /> <title>A page</title> </head> <body> <h1>A heading</h1> </body> On Sep 27, 3:51 am, Thomas Leitner <t_leit... at gmx.at> wrote:> > I would like to use Haml for pages (and possibly templates) and Sass > > for CSS. But I am a webgen newbie and can''t figure out the > > configuration. Is such a configuration possible? Could someone help me > > set it up? > > You need to put the following into your config.yaml file: > > default_processing_pipeline: > Page: haml,fragments > > Normally, the processing pipeline also includes erb, tags and blocks > tags, but I think they are not needed when using haml since haml > includes facilities to execute ruby commands (and tag results can still > be used through the context object as well as block rendering). > > If you need to change the default for template files, just add another > entry with Template as key instead of Page. > > If you want to use sass for your CSS files, just name them something > like default.sass.css. This will tell the copy handler that sass should > be run on the content before writing it to the output path. > > If you need further help, don''t hesitate to write again! > > Best regars, > Thomas > _______________________________________________ > webgen-users mailing list > webgen-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/webgen-users
Am Sun, 27 Sep 2009 07:52:41 -0700 (PDT) schrieb Mick Koch <kchmck at gmail.com>:> Thank you for your help! I think I''m getting the hang of it now. Just > for future > reference, this is a bare bones setup: > > config.yaml > ==========> default_processing_pipeline: > Page: haml,fragments > Template: haml,fragments >You only need to specify the fragments content processor once. If you specify it for the page file, only headers of the page content itself will be mapped to fragment nodes. If you specify it for templates, all headers will be mapped to fragment nodes which may not be what you want. Also note that only headers with IDs get mapped to fragment nodes. -- Thomas
On Sep 28, 5:22 am, Thomas Leitner <t_leit... at gmx.at> wrote:> > config.yaml > > ==========> > default_processing_pipeline: > > Page: haml,fragments > > Template: haml,fragments > > You only need to specify the fragments content processor once. If you > specify it for the page file, only headers of the page content itself > will be mapped to fragment nodes. If you specify it for templates, all > headers will be mapped to fragment nodes which may not be what you > want. Also note that only headers with IDs get mapped to fragment nodes.Ah, okay. Good to know.