-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
29 lines (24 loc) · 868 Bytes
/
config.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class RewriteMarkdownPaths < Middleman::Extension
# https://github.com/middleman/middleman-blog/issues/277
def manipulate_resource_list(resources)
resources.each do |resource|
next unless resource.source_file.end_with?('.markdown')
resource.options[:content_type] = "text/html"
resource.destination_path << "/index.html"
end
end
end
::Middleman::Extensions.register(:rewrite_markdown_paths, RewriteMarkdownPaths)
activate :blog do |blog|
blog.sources = 'articles/:year-:month-:day-:title'
blog.permalink = ':year/:month/:day/:title'
end
activate :syntax
activate :directory_indexes
activate :rewrite_markdown_paths
set :haml, { ugly: true, format: :html5 }
page "/feed.xml", layout: false
set :markdown_engine, :redcarpet
set :markdown, fenced_code_blocks: true,
autolink: true,
smartypants: true