diff --git a/_src/_plugins/octopress_filters.rb b/_src/_plugins/octopress_filters.rb new file mode 100644 index 00000000..d61ba30c --- /dev/null +++ b/_src/_plugins/octopress_filters.rb @@ -0,0 +1,32 @@ +# Filters taken from the Octopress project by Brandon Mathis. +# https://github.com/imathis/octopress/blob/master/plugins/octopress_filters.rb +module Jekyll + + module Filters + + # Used on the blog index to split posts on the marker + def excerpt(input) + if input.index(//i) + input.split(//i)[0] + else + input + end + end + + # Checks for excerpts (helpful for template conditionals) + def has_more(input) + input =~ //i ? true : false + end + + # Replaces relative urls with full urls + def expand_urls(input, url='') + url ||= '/' + input.gsub /(\s+(href|src)\s*=\s*["|']{1})(\/[^\"'>]*)/ do + $1+url+$3 + end + end + + end + +end +Liquid::Template.register_filter(Jekyll::Filters) diff --git a/_src/_posts/2012-06-13-retina-icons-in-wordpress-3-4.markdown b/_src/_posts/2012-06-13-retina-icons-in-wordpress-3-4.markdown index 6896a5da..5737daa7 100644 --- a/_src/_posts/2012-06-13-retina-icons-in-wordpress-3-4.markdown +++ b/_src/_posts/2012-06-13-retina-icons-in-wordpress-3-4.markdown @@ -18,6 +18,8 @@ And it looks gorgeous. Here's a detail screenshot of the admin area in 3.4 in fu ![](/media/wp34_retina_icons.png) + + So if you're a plugin developer you absolutely want to make sure to include retina assets for your plugin, like a double sized admin menu icon. There's just one problem: WordPress doesn't include anything to make this easy for developers. The functions `register_post_type()` and `add_menu_page()` only allow you to define one image as menu icon which then gets inserted as `img` tag. diff --git a/_src/_posts/2012-07-07-what-makes-twitter-twitter.markdown b/_src/_posts/2012-07-07-what-makes-twitter-twitter.markdown index 04bce772..9506353a 100644 --- a/_src/_posts/2012-07-07-what-makes-twitter-twitter.markdown +++ b/_src/_posts/2012-07-07-what-makes-twitter-twitter.markdown @@ -16,9 +16,9 @@ post_format: Couldn't agree more: > People. 140-character messages. That’s Twitter. - -So simple. So powerful. So fragile. - -So leave it alone. We’re talking. Don’t interrupt. +> +> So simple. So powerful. So fragile. +> +> So leave it alone. We’re talking. Don’t interrupt. But just rebuilding Twitter before it gets more "richer stories" and crammed by ads probably won't help: [We could build an open Twitter, but would anyone use it?](http://gigaom.com/2012/07/04/we-could-build-an-open-twitter-but-would-anyone-use-it/) diff --git a/_src/index.html b/_src/index.html index 41fc8366..3c2b4667 100644 --- a/_src/index.html +++ b/_src/index.html @@ -54,7 +54,13 @@ description: 'Blog of designer & developer Matthias Kretschmann' {% endif %} - {{ post.excerpt }} + {% capture has_more %}{{ post.content | has_more }}{% endcapture %} + + {% if has_more == 'true' %} + {{ post.content | post.excerpt | excerpt }} + {% else %} + {{ post.excerpt }} + {% endif %} Continue reading