I already had a project with .haml and .scss files in different folders.
I followed this guide here http://winstonyw.com/2013/02/24/jekyll_haml_sass_and_github_pages/ to create _plugins/haml.rb and _plugins/sass.rb
I moved all my .scss files to the ./assets/css/ folder
To make sure, I also created the layouts folder and put all the .haml files there.
I ran jekyll serve --watch and these .haml / .scss files were not converted to .html or .css files in _sites. I cannot access them through the browser.
I tried this file here and did not help https://gist.github.com/radamant/481456#file-haml_converter-rb
So what have I done wrong and how to watch all .haml / .scss files?
I came from the middlemanapp world, so jekyll is new to me.
UPDATE 1 :
My high level goals:
Use Jekyll to develop an interface with Sass and Haml
He must keep track of changes in files.
It should convert .sass /. scss files and Haml.css and .html on the clock. Sense I could go to http://localhost:4000/index.html , when in fact I have index.haml like Haml
My project does not match the directory structure specified in the Jekyll doc (with layout folder and others). It should be able to detect .sass and .haml files in other folders (I can specify this)
I do not want to change any .sass or .scss files in the header so that Jekyll can detect it. Because I already have tons (from Bootstrap)
UPDATE 2 :
Here is my new _config.yml
source: . destination: ./_site plugins: ./_plugins layouts: .
Basically, I want to have all .haml files in the main folder, not layouts . In _plugins , I have _plugins/haml.rb and _plugins/sass.rb , as mentioned above. However, it does not work when I created the index1.haml sample in the main folder, it did not convert when --watch
UPDATE 3 :
Here is my directory structure:
/www /_plugins haml.rb sass.rb /_layouts index1.haml _config.yml index1.haml
In haml.rb :
module Jekyll require 'haml' class HamlConverter < Converter safe true priority :low def matches(ext) ext =~ /haml/i end def output_ext(ext) ".html" end def convert(content) engine = Haml::Engine.new(content) engine.render rescue StandardError => e puts "!!! HAML Error: " + e.message end end end
In index1.haml (both files have the same content):
!!! %html %head %meta{charset: "utf-8"}/ %meta{content: "initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width", name: "viewport"}/ %title %body Test Test
In _config.yaml
--- source: . destination: ./_site plugins: ./_plugins layouts: ./_layouts ---
This still does not work for me. No .html files created.
UPDATE $ :
Adding this file to .haml files:
However, I can modify .haml files, but I try to avoid this with .sass / .scss . I have a lot of them from Bootstrap and other works. Is there a workaround?