Add slim-lang to as a templating engine

Tom Rutgers committed Aug 17, 2018
commit c6725828f7928924886efaead71675153b86159b
Showing 3 changed files with 15 additions and 1 deletions
Gemfile +3 -0
@@ @@ -4,6 +4,9 @@ gem 'middleman', '~> 4.2'
gem "middleman-blog"
gem 'middleman-autoprefixer'
gem "middleman-livereload"
+
+ gem "slim"
gem "bootstrap-sass", require: false
+
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby]
gem 'wdm', '~> 0.1', platforms: [:mswin, :mingw]
Gemfile.lock +5 -1
@@ @@ -97,7 +97,7 @@ GEM
padrino-support (0.13.3.4)
activesupport (>= 3.1)
parallel (1.12.1)
- public_suffix (3.0.2)
+ public_suffix (3.0.3)
rack (2.0.5)
rack-livereload (0.3.17)
rack
@@ @@ -106,6 +106,9 @@ GEM
ffi (>= 0.5.0, < 2)
sass (3.4.25)
servolux (0.13.0)
+ slim (3.0.9)
+ temple (>= 0.7.6, < 0.9)
+ tilt (>= 1.3.3, < 2.1)
temple (0.8.0)
thor (0.20.0)
thread_safe (0.3.6)
@@ @@ -124,6 +127,7 @@ DEPENDENCIES
middleman-autoprefixer
middleman-blog
middleman-livereload
+ slim
tzinfo-data
wdm (~> 0.1)
config.rb +7 -0
@@ @@ -4,6 +4,13 @@ require 'bootstrap-sass'
# Activate and configure extensions
# https://middlemanapp.com/advanced/configuration/#configuring-extensions
+ # Use '#id' and '.classname' as div shortcuts in slim
+ # http://slim-lang.com/
+ Slim::Engine.set_options shortcut: {
+ '#' => {tag: 'div', attr: 'id'},
+ '.' => {tag: 'div', attr: 'class'}
+ }
+
activate :autoprefixer do |prefix|
prefix.browsers = "last 2 versions"
end