Skip to content

Instantly share code, notes, and snippets.

View tdominey's full-sized avatar

Todd Dominey tdominey

View GitHub Profile
@tdominey
tdominey / gist:651a20548a8b862bb416
Created April 13, 2015 22:30
Show albums an image is part of (content.lens)
<koken:albums>
<li>
<strong>Albums:</strong>
<koken:loop>
<koken:link title="View {{ album.title }}">
{{ album.title }}
</koken:link>
</koken:loop>
</li>
</koken:albums>
@tdominey
tdominey / gist:19329464263d592dcbf9
Created October 21, 2014 20:05
Displaying topic in an album page
<koken:not empty="album.topics">
<!-- has a topic so let's do this -->
<koken:topics>
<koken:loop>
{{ page.title }}
<!-- or... -->
{{ essay.title }}
</koken:loop>
</koken:topics>
<koken:else>
pulse.on( 'item', function(e) {
alert(e.data.is_last);
});
@tdominey
tdominey / gist:1cf75b76c106888287b9
Created October 2, 2014 20:23
Hide cover description on mobile in Regale 2
@media only screen and (max-width: 767px) {
.cover_desc { display:none; }
}
@tdominey
tdominey / gist:4a18ba062078a8d4f805
Created October 2, 2014 17:13
Formatting date from Pulse data
pulse.on( 'transitionstart', function(e) {
var data = e.data,
date = $('.time');
date.html( $K.formattedDate(data.published_on) );
});
@tdominey
tdominey / gist:6b3f336f2a0c302738aa
Created September 30, 2014 17:14
Make inserted images smaller in essays/pages
.k-lens-essay figure img,
.k-lens-page figure img
{
max-width:300px;
height:auto;
}
@tdominey
tdominey / gist:46b84f977fe90218d10c
Created September 26, 2014 01:57
Targeting koken:navigation with a class
<nav id="main">
<koken:navigation />
</nav>
/* target it in css */
<style>
#main ul li a {
/* targets the link inside the nav */
}
</style>
@tdominey
tdominey / gist:cf17b1bc344a4ef3c778
Created September 26, 2014 01:33
Hide aside in Elementary content.lens
body.k-lens-content aside section {
display:none;
}
/* or for a specific one */
body.k-lens-content aside section:first-child {
display:none;
}
@tdominey
tdominey / gist:2f43804914d937abb248
Created September 23, 2014 19:41
Allow Regale 2 cover image to extend to edges
header.cover {
padding:0;
}
@tdominey
tdominey / gist:7656845c74de89650bfd
Last active August 29, 2015 14:04
Return album title when Pulse is displaying featured albums or a single album
pulse.on( 'transitionstart', function(e) {
var data = e.data.parent;
console.log(data.title);
console.log($K.formattedDate(data.published_on));
}