Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###
- # Page options, layouts, aliases and proxies
- ###
- # Per-page layout changes:
- #
- # With no layout
- page "/*.xml", layout: false
- page "/*.json", layout: false
- page "/*.txt", layout: false
- # With alternative layout
- # page "/path/to/file.html", layout: :otherlayout
- page "posts/*", :layout => :article_layout
- # 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" }
- ###
- # Set variables
- ###
- set :css_dir, "source/css"
- set :js_dir, "source/js"
- set :markdown_engine, :redcarpet
- set :markdown, :fenced_code_blocks => true, :smartypants => true
- ###
- # Extensions
- ###
- activate :directory_indexes
- activate :syntax, :line_numbers => true
- ###
- # Helpers
- ###
- activate :blog do |blog|
- # This will add a prefix to all links, template references and source paths
- # blog.prefix = "posts"
- blog.permalink = "posts/{year}-{month}-{day}-{title}.html"
- blog.layout = "article_layout"
- # Matcher for blog source files
- blog.sources = "posts/{year}-{month}-{day}-{title}.html"
- blog.taglink = "categories/{tag}.html"
- # blog.layout = "layout"
- blog.summary_separator = /(READMORE)/
- blog.summary_length = 250
- # blog.year_link = "{year}.html"
- # blog.month_link = "{year}/{month}.html"
- # blog.day_link = "{year}/{month}/{day}.html"
- # blog.default_extension = ".markdown"
- blog.tag_template = "tag.html"
- blog.calendar_template = "calendar.html"
- # Enable pagination
- blog.paginate = true
- blog.per_page = 5
- blog.page_link = "page/{num}"
- end
- page "/feed.xml", layout: false
- # Reload the browser automatically whenever files change
- configure :development do
- set :debug_assets, true
- end
- # Methods defined in the helpers block are available in templates
- helpers do
- def home_link
- link_to "Home", config[:host]
- end
- end
- # Build-specific configuration
- configure :build do
- config[:host] = "https://alec-stewart.xyz"
- # Minify CSS on build
- activate :minify_css
- # Minify Javascript on build
- require "uglifier"
- activate :minify_javascript, compressor: proc {
- ::Uglifier.new(:harmony => true, :mangle => {:toplevel => true}, :compress => {:unsafe => true})
- }
- # Minify HTML on build
- activate :minify_html
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement