1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 09:56:51 +01:00
This commit is contained in:
Matthias Kretschmann 2013-11-23 21:53:52 +01:00
parent d1b5bb8828
commit 37726d9dcd
19 changed files with 376 additions and 181 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
node_modules node_modules
_site _site
_src/_media/gen

View File

@ -17,7 +17,7 @@ module.exports = function(grunt){
grunt.log.writeln(""); grunt.log.writeln("");
grunt.log.writeln(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); grunt.log.writeln(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
grunt.log.writeln(""); grunt.log.writeln("");
grunt.log.writeln(" | (o) | Just what do you think you're doing, Matthias? "); grunt.log.writeln(" (o) Just what do you think you're doing, Matthias? ");
grunt.log.writeln(""); grunt.log.writeln("");
grunt.log.writeln(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); grunt.log.writeln(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
grunt.log.writeln(""); grunt.log.writeln("");
@ -80,12 +80,16 @@ module.exports = function(grunt){
uglify: { uglify: {
production: { production: {
options: { options: {
report: 'min', report: 'min'
mangle: true
}, },
files: { files: {
'<%= config.site %>/<%= config.assets.js %>/lib/picturefill.min.js': [
'<%= config.site %>/<%= config.assets.js %>/lib/picturefill.js'
],
'<%= config.site %>/<%= config.assets.js %>/kremalicious3.min.js': [ '<%= config.site %>/<%= config.assets.js %>/kremalicious3.min.js': [
'<%= config.src %>/<%= config.assets.js %>/picturefill.js', '<%= config.src %>/<%= config.assets.js %>/lib/infinitescroll/jquery.infinitescroll.js',
'<%= config.src %>/<%= config.assets.js %>/lib/socialite/socialite.js',
'<%= config.src %>/<%= config.assets.js %>/plugins.js',
'<%= config.src %>/<%= config.assets.js %>/app.js' '<%= config.src %>/<%= config.assets.js %>/app.js'
] ]
} }
@ -165,7 +169,6 @@ module.exports = function(grunt){
// rsync stuff around // rsync stuff around
rsync: { rsync: {
options: { options: {
recursive: true recursive: true
}, },
// copy media folder // copy media folder
@ -173,7 +176,7 @@ module.exports = function(grunt){
options: { options: {
src: '<%= config.src %>/_media/', src: '<%= config.src %>/_media/',
dest: '<%= config.site %>/media/', dest: '<%= config.site %>/media/',
args: ["--exclude='gen'"], args: ["--exclude='gen'"]
} }
}, },
// deployment // deployment

View File

@ -14,7 +14,7 @@ pygments: true
source: ./_src source: ./_src
destination: ./_site destination: ./_site
exclude: ['design', 'node_modules', 'less'] exclude: ['design', 'node_modules', 'less']
keep_files: ['media'] keep_files: ['media', 'gen']
picture: picture:
source: "_media" source: "_media"

View File

@ -22,3 +22,8 @@
<p class="license">Code snippets: <a rel="item-license" href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>. Goodies: <a rel="item-license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">CC BY NC SA</a>. Hosted by <a href="http://www.mediatemple.net#a_aid=4f37f8fe3e47e" title="Media Temple">(mt)</a></p> <p class="license">Code snippets: <a rel="item-license" href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>. Goodies: <a rel="item-license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">CC BY NC SA</a>. Hosted by <a href="http://www.mediatemple.net#a_aid=4f37f8fe3e47e" title="Media Temple">(mt)</a></p>
</section> </section>
</footer> </footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/assets/js/lib/jquery.min.js"><\/script>')</script>
<script src="/assets/js/kremalicious3.min.js"></script>

View File

@ -1,3 +1,30 @@
<!DOCTYPE html>
<!--
___ ___
/__/\ /__/|
| |::\ | |:|
| |:|:\ | |:|
__|__|:|\:\ __| |:|
/__/::::| \:\ /__/\_|:|____
\ \:\~~\__\/ \ \:\/:::::/
\ \:\ \ \::/~~~~
\ \:\ \ \:\
\ \:\ \ \:\
\__\/ \__\/
YOU EARNED THE GEEK ACHIEVEMENT
FOR LOOKING AT MY SOURCE
But because of all the minimizing and caching
going on you better check out the code on
github
_____________________________________________
https://github.com/kremalicious/kremalicious3
_____________________________________________
-->
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
@ -30,10 +57,16 @@
<link rel="stylesheet" href="/assets/css/{{ page.style }}"> <link rel="stylesheet" href="/assets/css/{{ page.style }}">
{% endif %} {% endif %}
<script src="/assets/js/lib/picturefill.min.js" async></script>
<script data-cfasync="false" src="//use.typekit.com/msu4qap.js"></script> <script data-cfasync="false" src="//use.typekit.com/msu4qap.js"></script>
<script data-cfasync="false">try{Typekit.load();}catch(e){}</script> <script data-cfasync="false">try{Typekit.load();}catch(e){}</script>
<script src="/assets/js/kremalicious3.min.js" defer async></script> {% if paginator %}
<script>
var total = {{ paginator.total_pages }};
</script>
{% endif %}
<!-- Twitter Cards --> <!-- Twitter Cards -->
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">

View File

@ -1,3 +1,4 @@
<header role="banner" class="banner container"> <header role="banner" class="banner container">
<div class="row"> <div class="row">
<h1 class="banner-title"> <h1 class="banner-title">

View File

@ -1,46 +1,16 @@
<!DOCTYPE html>
<!--
___ ___
/__/\ /__/|
| |::\ | |:|
| |:|:\ | |:|
__|__|:|\:\ __| |:|
/__/::::| \:\ /__/\_|:|____
\ \:\~~\__\/ \ \:\/:::::/
\ \:\ \ \::/~~~~
\ \:\ \ \:\
\ \:\ \ \:\
\__\/ \__\/
YOU EARNED THE GEEK ACHIEVEMENT {% include head.html %}
FOR LOOKING AT MY SOURCE
But because of all the minimizing and caching <body>
going on you better check out the code on
github
_____________________________________________
https://github.com/kremalicious/kremalicious3
_____________________________________________
-->
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
{% include head.html %}
<body>
{% include header.html %} {% include header.html %}
<section role="document" class="container"> <section role="document" class="container">
<section role="main" id="main" class="row">
{{ content }} {{ content }}
</section> </section>
</section>
{% include footer.html %} </body>
</body> {% include footer.html %}
</html>

View File

@ -2,7 +2,9 @@
layout: base layout: base
--- ---
<article class="hentry format-image"> <section role="main" id="main" class="row">
<article class="hentry format-image">
<div class="photoPost"> <div class="photoPost">
<figure class="hmedia"> <figure class="hmedia">
@ -28,4 +30,6 @@ layout: base
<p class="time">{{ page.date | date_to_string }} <span class="modtime"></span></p> <p class="time">{{ page.date | date_to_string }} <span class="modtime"></span></p>
</footer> </footer>
</article> </article>
</section>

View File

@ -2,7 +2,9 @@
layout: base layout: base
--- ---
<article class="hentry format-link"> <section role="main" id="main" class="row">
<article class="hentry format-link">
<header> <header>
<h1 class="entry-title"> <h1 class="entry-title">
<a href="{{ page.linkurl }}" title="Go to source">{{ page.title }} <i class="icon-forward"></i></a> <a href="{{ page.linkurl }}" title="Go to source">{{ page.title }} <i class="icon-forward"></i></a>
@ -26,4 +28,6 @@ layout: base
<p class="byline author vcard source-org"><span class="by">by</span> <a class="fn" rel="author" href="/about/">{{ page.author }}</a></p> <p class="byline author vcard source-org"><span class="by">by</span> <a class="fn" rel="author" href="/about/">{{ page.author }}</a></p>
<p class="time">{{ page.date | date_to_string }} <span class="modtime"></span></p> <p class="time">{{ page.date | date_to_string }} <span class="modtime"></span></p>
</footer> </footer>
</article> </article>
</section>

View File

@ -2,7 +2,9 @@
layout: base layout: base
--- ---
<article class="hentry format-post"> <section role="main" id="main" class="row">
<article class="hentry format-post">
<header> <header>
<h1 class="entry-title">{{ page.title }}</h1> <h1 class="entry-title">{{ page.title }}</h1>
</header> </header>
@ -29,4 +31,6 @@ layout: base
{% endif %} {% endif %}
</div> </div>
</footer> </footer>
</article> </article>
</section>

View File

@ -0,0 +1,138 @@
/*
MAIN JS FOR KREMALICIOUS.COM
-----------------------------------------------------------------
Copyright (c) 2013 Matthias Kretschmann | http://mkretschmann.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
$(ASAP = function(){
photoGrid.init();
});
$(window).load( AfterLoad = function() {
siteEffects.init();
infiniteScroll.init();
});
var photoGrid = {
masonryLayout: function() {
var $container = $('#main .masonry');
$container.imagesLoaded( function(){
$container.masonry({
itemSelector : 'article',
columnWidth : '.grid-sizer'
});
});
},
init: function(){
// only fire when photo post present and screen bigger than 480px
if ( $('#main .masonry').length > 0 && Modernizr.mq('only screen and (min-width: 480px)') ) {
this.masonryLayout();
}
}
}
var siteEffects = {
socialiteButtons: function() {
$('#tweetsWrap').one('mouseenter', function() {
Socialite.load($(this)[0]);
});
},
init: function(){
this.socialiteButtons();
}
}
var infiniteScroll = {
infiniteScrollSetup: function() {
if ( $('body.archive.category-photos').length > 0 ) {
var items = '#main .masonry';
} else {
var items = '#main article.hentry';
}
var $scrollContent = $('#main');
$scrollContent.infinitescroll({
itemSelector : items,
nextSelector : '.next a',
navSelector : '.pagination',
binder : $scrollContent,
behavior : 'krlc3',
}, function($scrollContent) {
// run picturefill over retrieved items
picturefill();
// run the photogrid over retrieved items
photoGrid.init();
});
},
init: function(){
this.infiniteScrollSetup();
}
}
/*
--------------------------------
Infinite Scroll Behavior
Manual mode with minimal loader
Usage: behavior: 'krlc3'
--------------------------------
*/
$.extend($.infinitescroll.prototype,{
_setup_krlc3: function infscr_setup_krlc3 () {
var opts = this.options,
instance = this,
loader = $('<span class="loading"> ...</span>');
$(opts.nextSelector).parent().parent().addClass('infiniteLoader');
// Bind nextSelector link to retrieve
$(opts.nextSelector).click(function(e) {
if (e.which == 1 && !e.metaKey && !e.shiftKey) {
e.preventDefault();
instance.retrieve();
}
});
// custom start
instance.options.loading.start = function (opts) {
loader
.appendTo(opts.nextSelector)
.show(opts.loading.speed, function () {
instance.beginAjax(opts);
});
}
// custom finish
instance.options.loading.finished = function(opts) {
loader.detach();
};
}
});

@ -0,0 +1 @@
Subproject commit 0c1e76f0b51bd420907875968465bdc6035be71d

6
_src/assets/js/lib/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
_src/assets/js/lib/modernizr.min.js vendored Normal file
View File

@ -0,0 +1,4 @@
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-cssanimations-touch-mq-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes
*/
;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return w("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.cssanimations=function(){return G("animationName")};for(var H in q)z(q,H)&&(v=H.toLowerCase(),e[v]=q[H](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},A(""),i=k=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.mq=x,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document);

@ -0,0 +1 @@
Subproject commit fb04be59c2f5bf010439b4c21f631be0028faa2d

16
_src/assets/js/plugins.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -71,16 +71,18 @@ a.nav-main-link {
// Infinite Loader // Infinite Loader
///////////////////////////////////// /////////////////////////////////////
.infiniteLoader p { .infiniteLoader .next {
width: 100% width: 100%;
float: none;
} }
.infiniteLoader .alignright, .infiniteLoader .previous,
.infiniteLoader .pagenumber,
.infiniteLoader i { .infiniteLoader i {
.hide; .hide;
} }
.infiniteLoader a { .infiniteLoader .next a {
.btn; .btn;
.aligncenter; .aligncenter;

View File

@ -4,7 +4,9 @@ title: kremalicious
description: 'Blog of designer & developer Matthias Kretschmann' description: 'Blog of designer & developer Matthias Kretschmann'
--- ---
{% for post in paginator.posts %} <section role="main" id="main" class="row">
{% for post in paginator.posts %}
{% if post.layout == "link" %} {% if post.layout == "link" %}
@ -70,7 +72,9 @@ description: 'Blog of designer & developer Matthias Kretschmann'
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</section>
<nav class="row pager pagination"> <nav class="row pager pagination">
{% if paginator.previous_page %} {% if paginator.previous_page %}
@ -84,7 +88,7 @@ description: 'Blog of designer & developer Matthias Kretschmann'
{% endif %} {% endif %}
</p> </p>
{% endif %} {% endif %}
<p class="col2 textcenter"> <p class="col2 pagenumber textcenter">
<span class="page_number ">Page {{ paginator.page }} of {{ paginator.total_pages }}</span> <span class="page_number ">Page {{ paginator.page }} of {{ paginator.total_pages }}</span>
</p> </p>
{% if paginator.next_page %} {% if paginator.next_page %}
@ -94,5 +98,3 @@ description: 'Blog of designer & developer Matthias Kretschmann'
</p> </p>
{% endif %} {% endif %}
</nav> </nav>