我一直在尝试使用middleman article 'test'
以下配置:
set :markdown_engine, :slim
activate :blog do |b|
b.sources = "posts/{year}{month}{day}-{title}.html.slim"
b.permalink = "{year}/{month}/{day}/{title}/index.html"
b.new_article_template = "lib/templates/article.html.slim"
b.layout = "layout-blog"
end
使用gem文件:
source 'https://rubygems.org'
source 'https://rails-assets.org'
ruby '2.1.0'
gem 'middleman', '~>3.3.3'
gem 'middleman-deploy'
gem 'middleman-pry'
gem 'middleman-blog'
gem 'slim'
gem 'pry'
gem 'font-awesome-middleman'
gem 'middleman-minify-html'
gem 'middleman-imageoptim', '~> 0.1.4'
gem 'rake'
gem 'highline'
gem 'rails-assets-jquery'
# Live-reloading plugin
gem 'middleman-livereload', '~> 3.1.0'
# For faster file watcher updates on Windows:
gem 'wdm', '~> 0.1.0', :platforms => [:mswin, :mingw]
# Windows does not come with time zone data
gem 'tzinfo-data', platforms: [:mswin, :mingw]
但现在重要的是我尝试新文章始终生成为.markdown
文件。
想法?
当前错误消息:
middleman article 'test2'
/Users/chrishough/BusinessNoConformity/CodeNoConformity/Blog/.bundle/ruby/2.1.0/gems/middleman-core-3.3.3/lib/middleman-core/renderers/markdown.rb:40:in `const_get': uninitialized constant Tilt::SlimTemplate (NameError)
答案 0 :(得分:2)
通过添加正确的扩展名解决它:
activate :blog do |b|
b.sources = "posts/{year}{month}{day}-{title}.html"
b.permalink = "{year}/{month}/{day}/{title}/index.html"
b.new_article_template = "lib/templates/article.html.erb"
b.layout = "layout-blog"
b.default_extension = ".slim"
end