Last active
August 29, 2015 14:15
-
-
Save lolmaus/13314995b326be27c957 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# Variables | |
- prev_page = prev_page ? prev_page.url : false | |
- next_page = next_page ? next_page.url : false | |
= partial "./bootstrap/components/pagination", | |
locals: { nextPage: "#{ next_page }", | |
prevPage: "#{ prev_page }", | |
pageNo: "#{ page_number }", | |
pages: "#{ num_pages }" } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# Pagination | |
%ul.pagination | |
-# Previous Page | |
- if locals[ :prevPage ] != "false" | |
%li= link_to string( "Prev" ), prevPage | |
-# Loop through the number of pages | |
- ( 1..locals[ :pages ].to_i ).each do | page | | |
-# Active | |
- if locals[ :pageNo ].to_i == page.to_i | |
-# Active List | |
%li.active | |
%span= page | |
- else | |
%li | |
-# Create Variables | |
- url = current_page.url | |
- newStr = url.sub( /\d+\/$/, page.to_s ) | |
- uri = URI.parse( url ) | |
- path = File.dirname( uri.path ) | |
- basename = File.basename( uri.to_s, ".html" ) | |
-# Page Number 1 | |
- if page == 1 | |
- newStr = url.sub( /page\/\d\/$/, "" ) | |
-# Page Matches Page/digit | |
- if ! url.match( /page\/\d+\/$/ ) | |
- if page == 1 | |
- newStr = url.sub( /\/page\/\d\.html/, ".html" ) | |
- elsif pageNo == "1" | |
- newStr = "#{ basename }/page/#{ page }.html" | |
- else | |
- newStr = "#{ path }/#{ page }.html" | |
-# Create Link | |
= link_to page, newStr | |
-# Next Page | |
- if locals[ :nextPage ] != "false" | |
%li= link_to string( "Next" ), nextPage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Middleman Configuration File | |
# | |
# @author Ian Warner <[email protected]> | |
## | |
# Variables | |
set :version, data.config.version | |
set :relative_links, true | |
set :strip_index_file, false | |
set :syntaxScheme, "ThankfulEyes" | |
set :path, "assets" | |
set :css_dir, "#{ path }/stylesheets" | |
set :js_dir, "#{ path }/javascripts" | |
set :images_dir, "#{ path }/images" | |
set :fonts_dir, "#{ path }/font" | |
set :partials_dir, "partial/_library" | |
set :haml, { ugly: true, format: :html5 } | |
set :build_dir, "www" | |
set :layout, "_library/site/sidebar-left" | |
# Markdown Engine | |
set :markdown_engine, :kramdown | |
set :markdown, :layout_engine => :haml, | |
:tables => true, | |
:autolink => true, | |
:smartypants => true | |
# Syntax Highlighting | |
activate :syntax, :line_numbers => true, :wrap => true | |
# i18n | |
I18n.enforce_available_locales = true | |
I18n.default_locale = :en | |
Time.zone = "Europe/London" | |
activate :i18n, :langs => [ :en ], :mount_at_root => :en | |
# Live reload | |
activate :livereload | |
# Global Layout Selection | |
page "atom.xml", :layout => false | |
page "channel.html", :layout => false | |
page "config.xml", :layout => false | |
page "feed.xml", :layout => false | |
page "runner.html", :layout => false | |
page "sitemap.xml", :layout => false | |
# Remove 404 from directory indexes | |
page "/404.html", :directory_index => false | |
# Compass | |
compass_config do | config | | |
config.output_style = :compressed | |
config.line_comments = false | |
end | |
# Sprockets | |
after_configuration do | |
sprockets.append_path File.join "#{ root }", "bower_components" | |
sprockets.append_path File.join "#{ root }", "bower_components/bootstrap-sass-official/assets/javascripts/bootstrap" | |
sprockets.append_path File.join "#{ root }", "bower_components/bootstrap-sass-official/assets/stylesheets/" | |
sprockets.append_path File.join "#{ root }", "bower_components/font-awesome/scss/" | |
sprockets.append_path "/assets/font" | |
end | |
# BLOG | |
activate :blog do | blog | | |
blog.prefix = "products" | |
blog.default_extension = ".md" | |
blog.permalink = ":title.html" | |
blog.sources = ":title.html" | |
blog.layout = "_library/blog/article" | |
blog.summary_separator = /(READMORE)/ | |
blog.summary_length = 250 | |
blog.calendar_template = "/blog/calendar/template.html" | |
blog.year_link = "/blog/calendar/:year.html" | |
blog.month_link = "/blog/calendar/:year/:month.html" | |
blog.day_link = "/blog/calendar/:year/:month/:day.html" | |
blog.tag_template = "/blog/tag/template.html" | |
blog.taglink = "/blog/tag/:tag.html" | |
blog.paginate = true | |
blog.per_page = 10 | |
blog.page_link = "page/:num" | |
blog.custom_collections = { | |
category: { | |
link: '/categories/{category}.html', | |
template: 'templates/category.html' | |
} | |
} | |
end | |
# Middleman Deploy | |
activate :deploy do | deploy | | |
deploy.method = :git | |
deploy.remote = "[email protected]:DryKISS/forkeyring.com.git" | |
end | |
# Build-specific configuration | |
configure :build do | |
# Use relative URLs | |
activate :relative_assets | |
# For example, change the Compass output style for deployment | |
activate :minify_css | |
# Minify Javascript on build | |
activate :minify_javascript | |
# Minify HTML | |
activate :minify_html | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment