さまざまなフォルダーに .haml および .scss ファイルを含むプロジェクトが既にありました。
このガイドに従って、http://winstonyw.com/2013/02/24/jekyll_haml_sass_and_github_pages/を作成_plugins/haml.rb
し、_plugins/sass.rb
すべての .scss ファイルを./assets/css/
フォルダーに移動しました
確認するために、フォルダーも作成layouts
し、そこにすべての .haml ファイルを配置しました。
実行したjekyll serve --watch
ところ、これらの .haml / .scss ファイルが _sites の .html または .css ファイルに変換されませんでした。ブラウザからもアクセスできません。
ここでこのファイルを試してみましたが、どちらも役に立ちませんでしたhttps://gist.github.com/radamant/481456#file-haml_converter-rb
では、私は何を間違えて、すべての .haml / .scss ファイルをライブで見ることができるのでしょうか?
私はmiddlemanapp
世界から来たのでjekyll
、私には新しいです。
更新 1 :
私の高レベルの目標は次のとおりです。
Sass と Haml を使用したフロントエンド開発に Jekyll を使用する
ファイルの変更を監視する必要があります
.sass / を変換する必要があります。scss ファイルと Haml を watch で .css と .html に変換します。
http://localhost:4000/index.html
実際に私がHamlとしてindex.hamlを持っているときに私が行くことができることを意味します私のプロジェクトは、Jekyll doc (レイアウト フォルダーなど) に記載されているディレクトリ構造に従っていません。これは、他のフォルダー内の .sass および .haml ファイルを検出できる必要があります (これを指定できます)
ヘッダー内の .sass または .scss ファイルを変更して、Jekyll に検出させたくありません。私はすでに(Bootstrapから)それらをたくさん持っているので
更新 2 :
これが私の新しいものです_config.yml
source: .
destination: ./_site
plugins: ./_plugins
layouts: .
.haml
基本的に、すべてのファイルをメインフォルダーに置きたいのですが、 layouts
. 上記のように_plugins
私は持ってい_plugins/haml.rb
ます。_plugins/sass.rb
それでも、index1.haml
メインフォルダーにサンプルを作成したときに動作せず、変換されませんでした--watch
更新 3 :
これが私のディレクトリ構造です:
/www
/_plugins
haml.rb
sass.rb
/_layouts
index1.haml
_config.yml
index1.haml
で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
(index1.haml
両方のファイルの内容は同じです):
!!!
%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
の_config.yaml
---
source: .
destination: ./_site
plugins: ./_plugins
layouts: ./_layouts
---
これはまだ私にはうまくいきません。.html ファイルは生成されません。
更新 $ :
これをファイルに追加すると、次のようになり.haml
ます。
---
title: Index
---
ただし、ファイルを変更することはできますが、 /ファイル.haml
でそれを行うことは避けようとしています。私は Bootstrap やその他の作品からたくさんのものを持っています。回避策はありますか?.sass
.scss