[Middleman 3] Middleman: プロジェクトファイルを SASS, Haml 変換し設定する

middleman v.4.0 のリリースが近づいているようなので、これまで触って得たナレッジをまとめておきたいシリーズ。

[markdown]
“`prettyprinted
% middleman version
Middleman 3.4.0
“`

## SASS へのファイル変換

CSS は SASS 記法を利用したいので [sass-convert](https://www.d-wood.com/blog/2015/01/26_7362.html) します。

> * [Sass 記法 (indented syntax) 入門 | deadwood](https://www.d-wood.com/blog/2015/01/26_7362.html)

“`prettyprinted
% sass-convert –from css –to sass source/stylesheets/all.css source/stylesheets/all.css.sass
“`

## Haml へのファイル変換と設定

おなじく HTML は Haml を利用したいので [html2haml](https://github.com/haml/html2haml) します。

> * [Haml 入門 | deadwood](https://www.d-wood.com/blog/2014/11/25_7229.html)
> * [ERB, HTML を Haml に変換する | deadwood](https://www.d-wood.com/blog/2015/11/13_7676.html)

“`prettyprinted
% html2haml -e source/index.html.erb source/index.html.haml
“`

さらに出力される HTML 内の quote を double quote に変更したいので、config.rb に設定を加えます。

> * [Haml: double quote attributes を設定する | deadwood](https://www.d-wood.com/blog/2014/11/24_7224.html)

“`ruby:config.rb
###
# Haml
###
# Double-quotes!
set :haml, { attr_wrapper: “\”” }
“`
[/markdown]