我一直试图将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)
最佳答案
通过添加正确的扩展名解决此问题,如下所示:
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
Middleman Post