Skip to content

Commit

Permalink
working flickr embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
yyolk committed Jun 7, 2012
1 parent 2088da9 commit 4fef8f9
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,34 @@
GEM
remote: http://rubygems.org/
specs:
albino (1.3.3)
posix-spawn (>= 0.3.6)
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
directory_watcher (1.4.1)
fast-stemmer (1.0.1)
fleakr (0.7.1)
hpricot (>= 0.6.164)
loggable (>= 0.2.0)
hpricot (0.8.6)
jekyll (0.11.2)
albino (~> 1.3)
classifier (~> 1.3)
directory_watcher (~> 1.1)
kramdown (~> 0.13)
liquid (~> 2.3)
maruku (~> 0.5)
kramdown (0.13.7)
liquid (2.3.0)
loggable (0.3.0)
maruku (0.6.0)
syntax (>= 1.0.0)
posix-spawn (0.3.6)
syntax (1.0.0)

PLATFORMS
ruby

DEPENDENCIES
fleakr
jekyll
6 changes: 6 additions & 0 deletions _config.yml
@@ -0,0 +1,6 @@
permalink: pretty

server: true
server_port: 8080

baseurl: /
5 changes: 5 additions & 0 deletions _layouts/default.html
@@ -0,0 +1,5 @@
---
layout: default
---

{{ content }}
13 changes: 13 additions & 0 deletions _layouts/post.html
@@ -0,0 +1,13 @@
<article>
<h1>{{ page.title }}</h1>

{% for flickr_url in page.flickr %}
<a href="{{ flickr_url }}">{{ flickr_url | flickr_image }}</a>
{% endfor %}

{{ page.content }}

<footer>
{{ post.date || date:"%Y-%m-%d" }}</br>
</footer>
</article>
27 changes: 27 additions & 0 deletions _plugins/flickr.rb
@@ -0,0 +1,27 @@
require 'liquid'
require 'fleakr'

Fleakr.api_key = "eae5ede55c1eda160c12f097f1abdf8f"
Fleakr.shared_secret = "acf9b9a1bd0e256b"
Fleakr.auth_token = "72157630069599284-647e005942e54f22"

CACHED_IMAGES = {}

module Flickr
def flickr_image(url)
return "<img alt='#{image_object(url).title}' src='#{image_object(url).large.url}'>"
end

def flickr_medium_image(url)
return "<img alt='#{image_object(url).title}' src='#{image_object(url).medium.url}'>"
end

private

def image_object(url)
CACHED_IMAGES[url] ||= Fleakr.resource_from_url(url)
end
end

Liquid::Template.register_filter(Flickr)

7 changes: 7 additions & 0 deletions _posts/2012-06-06-FlickrTest.md
@@ -0,0 +1,7 @@
---
layout: post
title: LIONS HEAD
flickr:
- http://www.flickr.com/photos/yyolk/5923911658
---
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
14 changes: 14 additions & 0 deletions _site/2012/06/06/FlickrTest/index.html
@@ -0,0 +1,14 @@
<article>
<h1>LIONS HEAD</h1>


<a href="http://www.flickr.com/photos/yyolk/5923911658"><img alt='LIONS HEAD' src='http://farm7.staticflickr.com/6132/5923911658_bddc0226a9_b.jpg'></a>


Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.


<footer>
</br>
</footer>
</article>
4 changes: 4 additions & 0 deletions _site/Gemfile
@@ -0,0 +1,4 @@
source :rubygems

gem 'jekyll'
gem 'fleakr'
34 changes: 34 additions & 0 deletions _site/Gemfile.lock
@@ -0,0 +1,34 @@
GEM
remote: http://rubygems.org/
specs:
albino (1.3.3)
posix-spawn (>= 0.3.6)
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
directory_watcher (1.4.1)
fast-stemmer (1.0.1)
fleakr (0.7.1)
hpricot (>= 0.6.164)
loggable (>= 0.2.0)
hpricot (0.8.6)
jekyll (0.11.2)
albino (~> 1.3)
classifier (~> 1.3)
directory_watcher (~> 1.1)
kramdown (~> 0.13)
liquid (~> 2.3)
maruku (~> 0.5)
kramdown (0.13.7)
liquid (2.3.0)
loggable (0.3.0)
maruku (0.6.0)
syntax (>= 1.0.0)
posix-spawn (0.3.6)
syntax (1.0.0)

PLATFORMS
ruby

DEPENDENCIES
fleakr
jekyll
5 changes: 5 additions & 0 deletions _site/index.html
@@ -0,0 +1,5 @@
<ul class='posts'>

<li><span>06 Jun 2012</span> &raquo; <a href='/2012/06/06/FlickrTest/'>LIONS HEAD</a></li>

</ul>
16 changes: 16 additions & 0 deletions index.html
@@ -0,0 +1,16 @@
---
layout: default
title:
---

<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Yolk Portfolio</title>

</head>
<body id="Hallo" onload="">
{% for post in posts %}

{% endfor %}
</body>
11 changes: 11 additions & 0 deletions index.md
@@ -0,0 +1,11 @@
---
layout: default
title: Hello World!
---

<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>

0 comments on commit 4fef8f9

Please sign in to comment.