blog init
This commit is contained in:
3
Gemfile
3
Gemfile
@ -4,7 +4,8 @@ gem "middleman", "~>3.3"
|
|||||||
gem "awesome_print"
|
gem "awesome_print"
|
||||||
gem "json", '~> 1.8'
|
gem "json", '~> 1.8'
|
||||||
|
|
||||||
gem "middleman-favicon-maker"
|
gem "middleman-favicon-maker" # https://github.com/follmann/middleman-favicon-maker
|
||||||
gem "middleman-livereload"
|
gem "middleman-livereload"
|
||||||
|
gem "middleman-blog"
|
||||||
|
|
||||||
gem "redcarpet"
|
gem "redcarpet"
|
||||||
|
@ -7,6 +7,7 @@ GEM
|
|||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
|
addressable (2.3.6)
|
||||||
awesome_print (1.2.0)
|
awesome_print (1.2.0)
|
||||||
celluloid (0.15.2)
|
celluloid (0.15.2)
|
||||||
timers (~> 1.1.0)
|
timers (~> 1.1.0)
|
||||||
@ -61,6 +62,10 @@ GEM
|
|||||||
middleman-sprockets (>= 3.1.2)
|
middleman-sprockets (>= 3.1.2)
|
||||||
sass (>= 3.2.17, < 4.0)
|
sass (>= 3.2.17, < 4.0)
|
||||||
uglifier (~> 2.5)
|
uglifier (~> 2.5)
|
||||||
|
middleman-blog (3.5.3)
|
||||||
|
addressable (~> 2.3.5)
|
||||||
|
middleman-core (~> 3.2)
|
||||||
|
tzinfo (>= 0.3.0)
|
||||||
middleman-core (3.3.5)
|
middleman-core (3.3.5)
|
||||||
activesupport (~> 4.1.0)
|
activesupport (~> 4.1.0)
|
||||||
bundler (~> 1.1)
|
bundler (~> 1.1)
|
||||||
@ -131,6 +136,7 @@ DEPENDENCIES
|
|||||||
awesome_print
|
awesome_print
|
||||||
json (~> 1.8)
|
json (~> 1.8)
|
||||||
middleman (~> 3.3)
|
middleman (~> 3.3)
|
||||||
|
middleman-blog
|
||||||
middleman-favicon-maker
|
middleman-favicon-maker
|
||||||
middleman-livereload
|
middleman-livereload
|
||||||
redcarpet
|
redcarpet
|
||||||
|
@ -49,6 +49,10 @@ after_configuration do
|
|||||||
sprockets.append_path File.join "#{root}", @bower_config["directory"]
|
sprockets.append_path File.join "#{root}", @bower_config["directory"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
activate :blog do |blog|
|
||||||
|
# set options on blog
|
||||||
|
end
|
||||||
|
|
||||||
#video pages
|
#video pages
|
||||||
data.video.keys.each do |vdo|
|
data.video.keys.each do |vdo|
|
||||||
proxy "video/#{vdo}.html", 'video/template.html', locals: {video: data.video[vdo]}, ignore: true
|
proxy "video/#{vdo}.html", 'video/template.html', locals: {video: data.video[vdo]}, ignore: true
|
||||||
|
7
source/blog/2012-01-01-example-article.html.markdown
Normal file
7
source/blog/2012-01-01-example-article.html.markdown
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
title: Example Article
|
||||||
|
date: 2012-01-01
|
||||||
|
tags: example
|
||||||
|
---
|
||||||
|
|
||||||
|
This is an example article. You probably want to delete it and write your own articles!
|
33
source/blog/calendar.html.erb
Normal file
33
source/blog/calendar.html.erb
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
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 %>
|
||||||
|
<% end %>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<% if paginate && num_pages > 1 %>
|
||||||
|
<p>Page <%= page_number %> of <%= num_pages %></p>
|
||||||
|
|
||||||
|
<% if prev_page %>
|
||||||
|
<p><%= link_to 'Previous page', prev_page %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<% page_articles.each_with_index do |article, i| %>
|
||||||
|
<li><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<% if paginate %>
|
||||||
|
<% if next_page %>
|
||||||
|
<p><%= link_to 'Next page', next_page %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
24
source/blog/feed.xml.builder
Normal file
24
source/blog/feed.xml.builder
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
xml.instruct!
|
||||||
|
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
|
||||||
|
site_url = "http://blog.url.com/"
|
||||||
|
xml.title "Blog Name"
|
||||||
|
xml.subtitle "Blog subtitle"
|
||||||
|
xml.id URI.join(site_url, blog.options.prefix.to_s)
|
||||||
|
xml.link "href" => URI.join(site_url, blog.options.prefix.to_s)
|
||||||
|
xml.link "href" => URI.join(site_url, current_page.path), "rel" => "self"
|
||||||
|
xml.updated(blog.articles.first.date.to_time.iso8601) unless blog.articles.empty?
|
||||||
|
xml.author { xml.name "Blog Author" }
|
||||||
|
|
||||||
|
blog.articles[0..5].each do |article|
|
||||||
|
xml.entry do
|
||||||
|
xml.title article.title
|
||||||
|
xml.link "rel" => "alternate", "href" => URI.join(site_url, article.url)
|
||||||
|
xml.id URI.join(site_url, article.url)
|
||||||
|
xml.published article.date.to_time.iso8601
|
||||||
|
xml.updated File.mtime(article.source_file).iso8601
|
||||||
|
xml.author { xml.name "Article Author" }
|
||||||
|
# xml.summary article.summary, "type" => "html"
|
||||||
|
xml.content article.body, "type" => "html"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
24
source/blog/index.html.erb
Normal file
24
source/blog/index.html.erb
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
pageable: true
|
||||||
|
per_page: 10
|
||||||
|
---
|
||||||
|
<% if paginate && num_pages > 1 %>
|
||||||
|
<p>Page <%= page_number %> of <%= num_pages %></p>
|
||||||
|
|
||||||
|
<% if prev_page %>
|
||||||
|
<p><%= link_to 'Previous page', prev_page %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% page_articles.each_with_index do |article, i| %>
|
||||||
|
<h2><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></h2>
|
||||||
|
<!-- use article.summary(250) if you have Nokogiri available to show just
|
||||||
|
the first 250 characters -->
|
||||||
|
<%= article.body %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if paginate %>
|
||||||
|
<% if next_page %>
|
||||||
|
<p><%= link_to 'Next page', next_page %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
38
source/blog/layout.erb
Normal file
38
source/blog/layout.erb
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
|
||||||
|
<title>Blog Title<%= ' - ' + current_article.title unless current_article.nil? %></title>
|
||||||
|
<%= feed_tag :atom, "#{blog.options.prefix.to_s}/feed.xml", title: "Atom Feed" %>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="main" role="main">
|
||||||
|
<%= yield %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<aside>
|
||||||
|
<h2>Recent Articles</h2>
|
||||||
|
<ol>
|
||||||
|
<% blog.articles[0...10].each do |article| %>
|
||||||
|
<li><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></li>
|
||||||
|
<% end %>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h2>Tags</h2>
|
||||||
|
<ol>
|
||||||
|
<% blog.tags.each do |tag, articles| %>
|
||||||
|
<li><%= link_to "#{tag} (#{articles.size})", tag_path(tag) %></li>
|
||||||
|
<% end %>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<h2>By Year</h2>
|
||||||
|
<ol>
|
||||||
|
<% blog.articles.group_by {|a| a.date.year }.each do |year, articles| %>
|
||||||
|
<li><%= link_to "#{year} (#{articles.size})", blog_year_path(year) %></li>
|
||||||
|
<% end %>
|
||||||
|
</ol>
|
||||||
|
</aside>
|
||||||
|
</body>
|
||||||
|
</html>
|
25
source/blog/tag.html.erb
Normal file
25
source/blog/tag.html.erb
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
pageable: true
|
||||||
|
per_page: 12
|
||||||
|
---
|
||||||
|
<h1>Articles tagged '<%= tagname %>'</h1>
|
||||||
|
|
||||||
|
<% if paginate && num_pages > 1 %>
|
||||||
|
<p>Page <%= page_number %> of <%= num_pages %></p>
|
||||||
|
|
||||||
|
<% if prev_page %>
|
||||||
|
<p><%= link_to 'Previous page', prev_page %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<% page_articles.each_with_index do |article, i| %>
|
||||||
|
<li><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<% if paginate %>
|
||||||
|
<% if next_page %>
|
||||||
|
<p><%= link_to 'Next page', next_page %></p>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
BIN
source/video/BackInTheDay_640x360.mov
Normal file
BIN
source/video/BackInTheDay_640x360.mov
Normal file
Binary file not shown.
BIN
source/video/BackInTheDay_640x360.png
Normal file
BIN
source/video/BackInTheDay_640x360.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 212 KiB |
BIN
source/video/BalloonTime_400x262.mov
Normal file
BIN
source/video/BalloonTime_400x262.mov
Normal file
Binary file not shown.
BIN
source/video/BalloonTime_400x262.png
Normal file
BIN
source/video/BalloonTime_400x262.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 KiB |
BIN
source/video/CCrawl_purple_960x540.m4v
Normal file
BIN
source/video/CCrawl_purple_960x540.m4v
Normal file
Binary file not shown.
BIN
source/video/CCrawl_purple_960x540.png
Normal file
BIN
source/video/CCrawl_purple_960x540.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 865 KiB |
BIN
source/video/CrawlDemo_960x540.mov
Normal file
BIN
source/video/CrawlDemo_960x540.mov
Normal file
Binary file not shown.
BIN
source/video/CrawlDemo_960x540.png
Normal file
BIN
source/video/CrawlDemo_960x540.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 513 KiB |
BIN
source/video/LAS_InventYourFuture_720x404.mp4
Normal file
BIN
source/video/LAS_InventYourFuture_720x404.mp4
Normal file
Binary file not shown.
BIN
source/video/LAS_InventYourFuture_720x404.png
Normal file
BIN
source/video/LAS_InventYourFuture_720x404.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
BIN
source/video/MarkMoser_reel2011.mp4
Normal file
BIN
source/video/MarkMoser_reel2011.mp4
Normal file
Binary file not shown.
BIN
source/video/SecretGarden_Alternate-640.m4v
Normal file
BIN
source/video/SecretGarden_Alternate-640.m4v
Normal file
Binary file not shown.
BIN
source/video/SecretGarden_Alternate-640.png
Normal file
BIN
source/video/SecretGarden_Alternate-640.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 298 KiB |
45
source/video/template.html.haml
Normal file
45
source/video/template.html.haml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
title: Video
|
||||||
|
---
|
||||||
|
|
||||||
|
.spacer-50
|
||||||
|
.row
|
||||||
|
.col-sm-12
|
||||||
|
%h3= video.title
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-sm-12
|
||||||
|
.player
|
||||||
|
- if video.vimeo?
|
||||||
|
= video.vimeo
|
||||||
|
- else
|
||||||
|
:ruby
|
||||||
|
options = {
|
||||||
|
src: "/video/#{video.file}",
|
||||||
|
style:"width:#{video.width}px; height:#{video.height}px",
|
||||||
|
poster: "/video/#{video.poster}",
|
||||||
|
}
|
||||||
|
%video{video.options.merge(options)}
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-sm-12
|
||||||
|
- if video.note
|
||||||
|
%p= video.note
|
||||||
|
|
||||||
|
- if video.role?
|
||||||
|
%p My Role: #{video.role}
|
||||||
|
|
||||||
|
- if video.credit
|
||||||
|
%p
|
||||||
|
Credits:
|
||||||
|
%br
|
||||||
|
= video.credit
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-sm-12
|
||||||
|
.side-links
|
||||||
|
%ul
|
||||||
|
%li More Videos:
|
||||||
|
- data.video.each do |vdo, video|
|
||||||
|
%li= link_to video.title, "#{vdo}.html"
|
||||||
|
|
Reference in New Issue
Block a user