diff --git a/Gemfile b/Gemfile index 9b98e94..399e147 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source "https://rubygems.org" gem "middleman", "~>3.3" gem "awesome_print" gem "json", '~> 1.8' +gem 'nokogiri' gem "middleman-favicon-maker" # https://github.com/follmann/middleman-favicon-maker gem "middleman-livereload" diff --git a/Gemfile.lock b/Gemfile.lock index d838bee..aa8d9fc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -90,8 +90,11 @@ GEM sprockets (~> 2.12.1) sprockets-helpers (~> 1.1.0) sprockets-sass (~> 1.2.0) + mini_portile (0.5.2) minitest (5.4.1) multi_json (1.10.1) + nokogiri (1.6.1) + mini_portile (~> 0.5.0) padrino-helpers (0.12.3) i18n (~> 0.6, >= 0.6.7) padrino-support (= 0.12.3) @@ -139,4 +142,5 @@ DEPENDENCIES middleman-blog middleman-favicon-maker middleman-livereload + nokogiri redcarpet diff --git a/config.rb b/config.rb index 852f3e9..5399cbc 100644 --- a/config.rb +++ b/config.rb @@ -50,7 +50,10 @@ after_configuration do end activate :blog do |blog| - # set options on blog + blog.paginate = true + blog.layout = "layouts/blog.html" + blog.tag_template = "tag.html" + blog.sources = "blog/{title}.html" end #video pages @@ -58,6 +61,8 @@ data.video.keys.each do |vdo| proxy "video/#{vdo}.html", 'video/template.html', locals: {video: data.video[vdo]}, ignore: true end +activate :directory_indexes + # Build-specific configuration configure :build do # For example, change the Compass output style for deployment diff --git a/source/blog/a-fresh-start.html.haml b/source/blog/a-fresh-start.html.haml new file mode 100644 index 0000000..099bd3b --- /dev/null +++ b/source/blog/a-fresh-start.html.haml @@ -0,0 +1,12 @@ +--- +title: A Fresh Start +poster: /assets/img/star_nasa.jpg +date: 2014-09-16 +tags: example +--- + +.spacer-100 +.row + .col-sm-12 + A new thing + diff --git a/source/blog/calendar.html.erb b/source/blog/calendar.html.erb deleted file mode 100644 index 4cdfdf9..0000000 --- a/source/blog/calendar.html.erb +++ /dev/null @@ -1,33 +0,0 @@ ---- -pageable: true ---- -
Page <%= page_number %> of <%= num_pages %>
- - <% if prev_page %> -<%= link_to 'Previous page', prev_page %>
- <% end %> -<% end %> - -<%= link_to 'Next page', next_page %>
- <% end %> -<% end %> diff --git a/source/blog/2012-01-01-example-article.html.markdown b/source/blog/example-article.html.markdown similarity index 100% rename from source/blog/2012-01-01-example-article.html.markdown rename to source/blog/example-article.html.markdown diff --git a/source/blog/index.html.erb b/source/blog/index.html.erb deleted file mode 100644 index 0fae27e..0000000 --- a/source/blog/index.html.erb +++ /dev/null @@ -1,24 +0,0 @@ ---- -pageable: true -per_page: 10 ---- -<% if paginate && num_pages > 1 %> -Page <%= page_number %> of <%= num_pages %>
- - <% if prev_page %> -<%= link_to 'Previous page', prev_page %>
- <% end %> -<% end %> - -<% page_articles.each_with_index do |article, i| %> -<%= link_to 'Next page', next_page %>
- <% end %> -<% end %> diff --git a/source/blog/layout.erb b/source/blog/layout.erb deleted file mode 100644 index 36c3da9..0000000 --- a/source/blog/layout.erb +++ /dev/null @@ -1,38 +0,0 @@ - - - - - -Page <%= page_number %> of <%= num_pages %>
- - <% if prev_page %> -<%= link_to 'Previous page', prev_page %>
- <% end %> -<% end %> - -<%= link_to 'Next page', next_page %>
- <% end %> -<% end %> diff --git a/source/calendar.html.haml b/source/calendar.html.haml new file mode 100644 index 0000000..83e2f70 --- /dev/null +++ b/source/calendar.html.haml @@ -0,0 +1,25 @@ +--- +pageable: true +--- +%h1 + Archive for + - case page_type + - when 'day' + = Date.new(year, month, day).strftime('%b %e %Y') + - when 'month' + = Date.new(year, month, 1).strftime('%b %Y') + - when 'year' + = year +- if paginate && num_pages > 1 + %p + Page #{page_number} of #{num_pages} + - if prev_page + %p= link_to 'Previous page', prev_page +%ul + - page_articles.each_with_index do |article, i| + %li + = link_to article.title, article + %span= article.date.strftime('%b %e') +- if paginate + - if next_page + %p= link_to 'Next page', next_page diff --git a/source/contact/index.html.haml b/source/contact.html.haml similarity index 100% rename from source/contact/index.html.haml rename to source/contact.html.haml diff --git a/source/blog/feed.xml.builder b/source/feed.xml.builder similarity index 100% rename from source/blog/feed.xml.builder rename to source/feed.xml.builder diff --git a/source/index.haml b/source/index.haml index 933e44a..7587961 100644 --- a/source/index.haml +++ b/source/index.haml @@ -1,8 +1,20 @@ --- -title: A Fresh Start -poster: /assets/img/star_nasa.jpg +pageable: true +per_page: 10 +poster: /assets/img/bg/tree_bark.png --- -.spacer-100 -.row - .col-sm-12 - A new thing + + +- if paginate && num_pages > 1 + %p + Page #{page_number} of #{num_pages} + - if prev_page + %p= link_to 'Previous page', prev_page +- page_articles.each_with_index do |article, i| + %h2 + = link_to article.title, article + = article.summary(250) + +- if paginate + - if next_page + %p= link_to 'Next page', next_page diff --git a/source/layouts/blog.html.haml b/source/layouts/blog.html.haml new file mode 100644 index 0000000..3a26fa8 --- /dev/null +++ b/source/layouts/blog.html.haml @@ -0,0 +1,48 @@ +!!! +/[if lt IE 7] +/ [if IE 7] "X-UA-Compatible"}/ + %meta{content: "width=device-width,initial-scale=1.0", name: "viewport"}/ + %meta{content: page_description, name: "description"}/ + %meta{content: page_keywords, name: "keywords"}/ + = feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed" + %title + = page_title + - # Blog Title#{' - ' + current_article.title unless current_article.nil?} + = stylesheet_link_tag "all" + = javascript_include_tag "vendor/modernizr" + = partial "shared/analytics" + = yield_content :head + + %body{class: page_classes} + /[if lt IE 8] +