How to install and use Slim template engine with Middleman

I am new to Middleman and ruby ​​in general.

I installed Ruby I installed Middleman and gems to run it.

I need to use slim instead of the standard template system.

So, I installed a thin stone. Thin site only says that I need to require "thin" to make it work.

The reseller website says that I only need to add the template engine to the config.rb file, but it does not give examples ...

For someone who does not have a ruby ​​background, this will not help.

I searched a few config.rb on git and they all have:

require 'slim'

AND

# Set slim-lang output style
Slim::Engine.set_default_options :pretty => true

# Set template languages
set :slim, :layout_engine => :slim

I added this to the config.rb file and created layout.slim and index.html.slim

When I upgrade my local server, I get:

Not Found

`/' not found.

, Boilerplace. , , , - , .

- - , ?

+5
3

, ... Google , , .

Slim, Middleman

  • gem "slim" gemfile
  • , gem install bundler
  • config.rb require 'slim'
  • , .
+12

middleman-slim yterajima .

.

$ gem install middleman
$ gem install middleman-slim
$ middleman init PROJECT_NAME --template slim
+1

Bundler tip: you can also enable multiple stones at once using Bundler.require. If you have stones in groups, you can include them as such:Bundler.require :group1, :group2 ...

0
source

All Articles