Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
120 lines (91 sloc) 2.47 KB
require 'builder'
require 'dotenv'
require 'sanitize'
require 'slugify'
Dotenv.load
###
# Blog settings
###
Time.zone = 'America/Los_Angeles'
activate :blog do |blog|
blog.default_extension = '.markdown'
blog.layout = 'dummy' # This intentionally doesn't exist.
blog.permalink = 'journal/:year/:title.html'
blog.sources = 'posts/:year-:month-:day-:title.html'
end
# Set Kramdown as our Markdown engine
set :markdown_engine, :kramdown
set :markdown, :smartypants => true
###
# Compass
###
# Change Compass configuration
compass_config do |config|
config.output_style = :compact
end
###
# Page options, layouts, aliases and proxies
###
# Per-page layout changes:
#
# With no layout
# page "/path/to/file.html", :layout => false
#
# With alternative layout
# page "/path/to/file.html", :layout => :otherlayout
#
# A path which all have the same layout
# with_layout :admin do
# page "/admin/*"
# end
# Proxy pages (http://middlemanapp.com/dynamic-pages/)
# proxy "/this-page-has-no-template.html", "/template-file.html", :locals => {
# :which_fake_page => "Rendering a fake page with a local variable" }
page '/feed.xml', :layout => false
page '/sitemap.xml', :layout => false
###
# Helpers
###
# Automatic image dimensions on image_tag helper
activate :automatic_image_sizes
# Use pretty URLs
activate :directory_indexes
# Reload the browser automatically whenever files change
activate :livereload, :host => '127.0.0.1'
# Autoprefixer configuration
activate :autoprefixer, browsers: ['last 3 versions', 'ie 8', 'ie 9']
# Middleman syntax-highlighting support
activate :syntax
# Methods defined in the helpers block are available in templates
helpers do
# Strip all HTML tags from string
def strip_tags(html)
Sanitize.clean(html.strip).strip
end
# Slugify a string
def slugify(string)
string.slugify
end
end
# Set the build directory to "/tmp" for Heroku's sake.
set :build_dir, 'tmp'
set :css_dir, 'assets/stylesheets'
set :js_dir, 'assets/javascripts'
set :images_dir, 'assets/images'
# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
activate :minify_css
# Minify Javascript on build
activate :minify_javascript
# Automatic HTML minification
activate :minify_html
# Gzipping functionality
activate :gzip
# Enable cache buster
# activate :asset_hash
# Use relative URLs
# activate :relative_assets
# Or use a different image path
# set :http_prefix, "/Content/images/"
end