Middleman Create Haml File
How to create .haml file in middleman?
Firstly, you should go middleman and you need to install middleman
1
|
|
Fine, you are installed middleman, now we start to create project in middleman
1
|
|
Then this command give you directory as shown below :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
If you can see this directories, you should open project with your IDE.
Now, We create .haml file but how ?
Go ahead and remove below files because these files don’t use in project.
- /source/images/background.png
- /source/images/middleman.png
- /source/javascript/all.js
- /source/stylesheets/all.css
- /source/stylesheets/normalize.css
- /source/layouts/layout.erb
- /source/index.html.erb
Now, Projects was removed from unused files.
Add HAML
Middleman appear to read HTML by default . Therefore, you should go to
1
|
|
in file write:
1
|
|
Now program convert to html5 from haml.
- Add a
1
|
|
file to the
/source/layouts
directory. In this file we write
1 2 3 4 5 6 7 8 9 |
|
Now we must create
1
|
|
in
`source/`
directory.
1
|
|
write in
`source/index.html.haml`
files.
We are create middleman project and write codes, How we run this program?
Wait! Dont worry, When writing to below command in terminal in order of this.
# Go to project path
cd project_name
bundle install
bundle exec middleman server
then we are seen
http://localhost:4567
like url. We should copy this url and paste on browser search bar.
That’s it! Try and see.