Skip to content

Instantly share code, notes, and snippets.

@timgauthier
timgauthier / gist:6727917
Created September 27, 2013 12:33
Broken Menu for youcantwritethat.com
<?php
// nested menu
$items = $pages->visible();
// only show the menu if items are available
if($items->count() > 0):
?>
<!-- Brand and toggle get grouped for better mobile display -->
<?php endif ?>
</div>
Crashlog created at 2014-04-10 12:59:21 +0200
===== MESSAGE:
LoadError: cannot load such file -- nokogiri
Make sure the gem is added to Gemfile and run `bundle install`.
===== COMPILATION STACK:
- [item] / (rep default)
@timgauthier
timgauthier / gemfile
Created April 10, 2014 13:49
Errors trying to bundle install
# If you have OpenSSL installed, we recommend updating
# the following line to use "https"
source 'http://rubygems.org'
gem "middleman", "~>3.3.2"
# Live-reloading plugin
gem "middleman-livereload", "~> 3.1.0"
# For faster file watcher updates on Windows:
<div class="navigation--wrapper">
<div class="navigation--button">
<div ><a href="<%= config[:baseurl] %>/"><i class="icon-logo button" ></i></a></div>
<div id="js-mobile-menu"><i class="icon-menu button"></i></div>
</div>
<ul class="navigation--menu" id="navigation-menu">
<li>
<%= link_to 'Projects', '/projects/index.html', :class => ("active" if current_page.data[:active].presence == 'projects') %>
<li>
<%= link_to 'Journal', (if current_page.data[:active].presence == 'journal' ? blog.articles.first.url : '/journal/index.html'), :class => ('active' if current_page.data[:active].presence == 'journal') %>
@timgauthier
timgauthier / navigation mixin
Created April 15, 2014 22:17
This is a mixing that lets me have a different colour for my navigation and masthead/header on each page of my personal portfolio
@mixin navigation-menu-mixin (
$color: red,
$background: red,
$active: 35,
$hover: 55,
$hover-background-tint: 15,
$anchor: 38,
$active-background-tint: 20
) {
@extend .navigation--menu;
NoMethodError at /journal/2014/daily-show-with-jon-steward/
undefined method `to_sym' for nil:NilClass
Ruby /Users/timgauthier/Sites/www/middleman_tutorial/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.2/lib/middleman-core/core_extensions/rendering.rb: in render_individual_file, line 230
Web GET localhost/journal/2014/daily-show-with-jon-steward/
Jump to:
GETPOSTCookiesENV
Traceback (innermost first)
/Users/timgauthier/Sites/www/middleman_tutorial/vendor/bundle/ruby/2.0.0/gems/middleman-core-3.3.2/lib/middleman-core/core_extensions/rendering.rb: in render_individual_file
@timgauthier
timgauthier / pagnation flip!
Created April 25, 2014 14:07
I need to flip the direction, so that the next button takes you to the next newest and the previous takes you to the previous oldest page.
<% (page_number - num_pages .. page_number + num_pages).select{|i| i > 0 && i <= num_pages}.each do |i| %>
<% if i == page_number %>
<li>
<span class="active">
<%= i %>
</span>
</li>
<% else %>
@timgauthier
timgauthier / menuSectionsOverlay.scss
Created September 22, 2016 13:49
The SCSS magic that makes my websites overlays.
.sections {
// background: grey;
color: $white;
h2 {
padding-top: rem-calc(32);
padding-bottom: rem-calc(32);
padding-left: rem-calc(24);
padding-left: rem-calc(24);
font-size: rem-calc(26);
font-family: $body-font-family;