diff --git a/.gitignore b/.gitignore index 9357d2e..4ad77ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -_layouts/private-* -_site -private +/_layouts/private-* +/_site +/asset +/private diff --git a/_config.yml b/_config.yml index 798e2b7..caa29df 100644 --- a/_config.yml +++ b/_config.yml @@ -1,4 +1,4 @@ markdown: redcarpet paginate: 7 pygments: true -safe: true +safe: false diff --git a/_includes/disqus.html b/_includes/disqus.html new file mode 100644 index 0000000..1171150 --- /dev/null +++ b/_includes/disqus.html @@ -0,0 +1,17 @@ +
+
+ + + comments powered by Disqus +
diff --git a/_includes/header.html b/_includes/header.html index fe3c964..703e1e8 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -11,6 +11,10 @@ + {% if page.path %} + + {% endif %} + diff --git a/_layouts/gallery-photo.html b/_layouts/gallery-photo.html new file mode 100644 index 0000000..150773a --- /dev/null +++ b/_layouts/gallery-photo.html @@ -0,0 +1,82 @@ +{% include header.html %} +
+
+
+ {% if page.date %} + + {% endif %} + {% if page.location %} + map + {% endif %} + {% if page.code %} + code + {% endif %} +
+ +

+ {{ page.title }} + {{ page.date|date:'%A, %B %d, %Y' }} +

+
+
+

+ Photo: {{ page.title }} +

+ + {{ content }} +
+
+
+
+
+
Date
+
{{ page.date|date:'%A, %B %d, %Y at %I:%M %p'|replace:' 0',' '|replace:' AM',' am'|replace:' PM',' pm' }} + +
Camera
+
{{ page.exif.make }} {{ page.exif.model }} + +
Aperture
+
{{ page.exif.aperture }}
+ +
Exposure
+
{{ page.exif.exposure }}
+
+
+ + {% if page.location %} +
+ map +
+ {% endif %} + +
+
+
+ {% if page.next %} +
+ +
+ {% endif %} + + {% if page.previous %} +
+ +
+ {% endif %} + +
+ Gallery List +
+ +
+
+
+ +
+
+
+ {% include disqus.html %} +
+{% include footer.html %} diff --git a/_layouts/post.html b/_layouts/post.html index bda2975..7601de1 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -2,12 +2,14 @@
- + {% if page.date %} + + {% endif %} {% if page.location %} map {% endif %} {% if page.code %} - code + code {% endif %}
{% include footer.html %} diff --git a/_plugins/loopdir.rb b/_plugins/loopdir.rb new file mode 100644 index 0000000..a4e8f14 --- /dev/null +++ b/_plugins/loopdir.rb @@ -0,0 +1,85 @@ +# inspired by +# - https://gist.github.com/jgatjens/8925165 +# - http://simon.heimlicher.com/articles/2012/02/01/jekyll-directory-listing + +module Jekyll + class Loopdir < Liquid::Block + include Liquid::StandardFilters + Syntax = /(#{Liquid::QuotedFragment}+)?/ + + def initialize(tag_name, markup, tokens) + @attributes = {} + + @attributes['path'] = nil; + @attributes['parse'] = 'true'; + @attributes['match'] = '*'; + @attributes['sort'] = 'asc'; + + markup.scan(Liquid::TagAttributes) do | key, value | + @attributes[key] = value + end + + if @attributes['path'].nil? + raise SyntaxError.new("The `path` attribute is missing for `loopdir` tag.") + end + + if 'true' == @attributes['parse'] + @attributes['parse'] = true + else + @attributes['parse'] = false + end + + super + end + + def render(context) + context.registers[:loopdir] ||= Hash.new(0) + + files = Dir.glob(File.join(@attributes['path'], @attributes['match'])) + + if @attributes['sort'].casecmp('desc') == 0 + files.sort! do | x, y | + y <=> x + end + else + files.sort! + end + + result = [] + + context.stack do + files.each do |pathname| + if @attributes['parse'] + data = {} + + content = File.read(pathname) + + if content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m + content = $POSTMATCH + + begin + data = YAML.load($1) + rescue => e + puts "YAML Exception reading #{name}: #{e.message}" + end + end + + data['name'] = File.basename(pathname, @attributes['match'].sub('*', '')) + data['path'] = pathname + data['content'] = content + + context['item'] = data + else + context['item'] = pathname + end + + result << render_all(@nodelist, context) + end + + result + end + end + end +end + +Liquid::Template.register_tag('loopdir', Jekyll::Loopdir) diff --git a/include/site/default.css b/include/site/default.css index 12c51e5..cc96ea7 100644 --- a/include/site/default.css +++ b/include/site/default.css @@ -232,6 +232,13 @@ dl dd { padding: 2px 0 0 146px; } +.meta-properties { + border-top: #F0F0F0 solid 1px; + margin-left: -8px; + margin-right: -8px; + padding: 10px 8px; +} + .meta-social { border-top: #F0F0F0 solid 1px; margin-left: -8px; @@ -239,6 +246,16 @@ dl dd { padding: 32px 6px 0; } +.meta-navigate { + border-top: #F0F0F0 solid 1px; + font-size: 15px; + font-weight: 400; + margin-left: -8px; + margin-right: -8px; + padding: 10px; + text-align: center; +} + .disqus { border-top: #F0F0F0 solid 1px; margin: 28px -8px 0; @@ -291,3 +308,16 @@ blockquote { margin: 14px 16px; padding: 1px 18px; } + +.list-gallery { + line-height: 0; +} + + .list-gallery img { + padding: 2px !important; + margin: 8px 7px 0 0; + } + + .list-gallery img:hover { + border: #999999 solid 1px !important; + }