2019-06-11 22:24:35 +00:00
|
|
|
require "slim"
|
2016-09-11 23:26:00 +00:00
|
|
|
|
|
|
|
###
|
|
|
|
# Page options, layouts, aliases and proxies
|
|
|
|
###
|
|
|
|
|
|
|
|
# Per-page layout changes:
|
|
|
|
#
|
|
|
|
# With no layout
|
2019-06-11 22:24:35 +00:00
|
|
|
page "/*.xml", layout: false
|
|
|
|
page "/*.json", layout: false
|
|
|
|
page "/*.txt", layout: false
|
2016-09-11 23:26:00 +00:00
|
|
|
|
2016-09-25 23:19:06 +00:00
|
|
|
# With alternative layout: we send the sidebar request to the default layout
|
2019-06-11 22:24:35 +00:00
|
|
|
page "docs/*", layout: :docs, locals: { sidebar_layout: "docs" }
|
2016-09-11 23:26:00 +00:00
|
|
|
|
|
|
|
# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
|
|
|
|
# proxy '/this-page-has-no-template.html', '/template-file.html', locals: {
|
|
|
|
# which_fake_page: 'Rendering a fake page with a local variable' }
|
|
|
|
|
|
|
|
###
|
|
|
|
# Helpers
|
|
|
|
###
|
|
|
|
|
|
|
|
# Reload the browser automatically whenever files change
|
|
|
|
configure :development do
|
|
|
|
activate :livereload
|
|
|
|
end
|
|
|
|
|
2019-11-06 00:05:46 +00:00
|
|
|
class Middleman::Cli::Build < Thor::Group
|
|
|
|
protected
|
|
|
|
|
|
|
|
def on_event(event_type, target, extra = nil)
|
|
|
|
# no logging
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-09-25 23:19:06 +00:00
|
|
|
# Methods defined in the helpers block are available in templates
|
2019-06-11 22:24:35 +00:00
|
|
|
require "lib/sidebar_helpers"
|
2016-09-25 23:19:06 +00:00
|
|
|
helpers SidebarHelpers
|
|
|
|
|
2016-09-11 23:26:00 +00:00
|
|
|
# Build-specific configuration
|
|
|
|
configure :build do
|
|
|
|
# Minify CSS on build
|
|
|
|
activate :minify_css
|
|
|
|
|
|
|
|
# Minify Javascript on build
|
|
|
|
activate :minify_javascript
|
|
|
|
end
|
|
|
|
|
2016-09-20 16:04:39 +00:00
|
|
|
activate :sprockets
|
2016-09-11 23:26:00 +00:00
|
|
|
activate :autoprefixer
|
|
|
|
activate :directory_indexes
|
2016-09-26 00:35:29 +00:00
|
|
|
activate :syntax
|
2019-06-11 22:24:35 +00:00
|
|
|
set :url_root, "https://inspec.io"
|
2018-02-22 00:42:55 +00:00
|
|
|
activate :search_engine_sitemap
|
2016-09-11 23:26:00 +00:00
|
|
|
set :trailing_slash, false
|
2016-09-26 00:35:29 +00:00
|
|
|
set :markdown_engine, :redcarpet
|
2017-08-31 18:43:42 +00:00
|
|
|
set :markdown, fenced_code_blocks: true, smartypants: true, coderay_line_numbers: :table, tables: true, with_toc_data: true
|