Hey.
This commit is contained in:
commit
d11223a6da
|
@ -0,0 +1,18 @@
|
|||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
#
|
||||
# If you find yourself ignoring temporary files generated by your text editor
|
||||
# or operating system, you probably want to add a global ignore instead:
|
||||
# git config --global core.excludesfile ~/.gitignore_global
|
||||
|
||||
# Ignore bundler config
|
||||
/.bundle
|
||||
|
||||
# Ignore the build directory
|
||||
/build
|
||||
|
||||
# Ignore cache
|
||||
/.sass-cache
|
||||
/.cache
|
||||
|
||||
# Ignore .DS_store file
|
||||
.DS_Store
|
|
@ -0,0 +1,12 @@
|
|||
# If you do not have OpenSSL installed, change
|
||||
# the following line to use 'http://'
|
||||
source "https://rubygems.org"
|
||||
|
||||
# Middleman Gems
|
||||
gem "middleman", "~> 4.1"
|
||||
gem "middleman-blog"
|
||||
|
||||
gem "redcarpet", "~> 3.3", ">= 3.3.3"
|
||||
|
||||
# For feed.xml.builder
|
||||
gem "builder", "~> 3.0"
|
|
@ -0,0 +1,113 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (5.0.7.2)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.6.0)
|
||||
public_suffix (>= 2.0.2, < 4.0)
|
||||
backports (3.14.0)
|
||||
builder (3.2.3)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.12.2)
|
||||
concurrent-ruby (1.1.5)
|
||||
contracts (0.13.0)
|
||||
dotenv (2.7.2)
|
||||
erubis (2.7.0)
|
||||
execjs (2.7.0)
|
||||
fast_blank (1.0.0)
|
||||
fastimage (2.1.5)
|
||||
ffi (1.10.0)
|
||||
haml (5.0.4)
|
||||
temple (>= 0.8.0)
|
||||
tilt
|
||||
hamster (3.0.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
hashie (3.6.0)
|
||||
i18n (0.9.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
kramdown (1.17.0)
|
||||
listen (3.0.8)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
memoist (0.16.0)
|
||||
middleman (4.3.3)
|
||||
coffee-script (~> 2.2)
|
||||
haml (>= 4.0.5)
|
||||
kramdown (~> 1.2)
|
||||
middleman-cli (= 4.3.3)
|
||||
middleman-core (= 4.3.3)
|
||||
middleman-blog (4.0.3)
|
||||
addressable (~> 2.3)
|
||||
middleman-core (>= 4.0.0)
|
||||
tzinfo (>= 0.3.0)
|
||||
middleman-cli (4.3.3)
|
||||
thor (>= 0.17.0, < 2.0)
|
||||
middleman-core (4.3.3)
|
||||
activesupport (>= 4.2, < 5.1)
|
||||
addressable (~> 2.3)
|
||||
backports (~> 3.6)
|
||||
bundler
|
||||
contracts (~> 0.13.0)
|
||||
dotenv
|
||||
erubis
|
||||
execjs (~> 2.0)
|
||||
fast_blank
|
||||
fastimage (~> 2.0)
|
||||
hamster (~> 3.0)
|
||||
hashie (~> 3.4)
|
||||
i18n (~> 0.9.0)
|
||||
listen (~> 3.0.0)
|
||||
memoist (~> 0.14)
|
||||
padrino-helpers (~> 0.13.0)
|
||||
parallel
|
||||
rack (>= 1.4.5, < 3)
|
||||
sassc (~> 2.0)
|
||||
servolux
|
||||
tilt (~> 2.0.9)
|
||||
uglifier (~> 3.0)
|
||||
minitest (5.11.3)
|
||||
padrino-helpers (0.13.3.4)
|
||||
i18n (~> 0.6, >= 0.6.7)
|
||||
padrino-support (= 0.13.3.4)
|
||||
tilt (>= 1.4.1, < 3)
|
||||
padrino-support (0.13.3.4)
|
||||
activesupport (>= 3.1)
|
||||
parallel (1.17.0)
|
||||
public_suffix (3.0.3)
|
||||
rack (2.0.7)
|
||||
rake (12.3.2)
|
||||
rb-fsevent (0.10.3)
|
||||
rb-inotify (0.10.0)
|
||||
ffi (~> 1.0)
|
||||
redcarpet (3.4.0)
|
||||
sassc (2.0.1)
|
||||
ffi (~> 1.9)
|
||||
rake
|
||||
servolux (0.13.0)
|
||||
temple (0.8.1)
|
||||
thor (0.20.3)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.9)
|
||||
tzinfo (1.2.5)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (3.2.0)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
builder (~> 3.0)
|
||||
middleman (~> 4.1)
|
||||
middleman-blog
|
||||
redcarpet (~> 3.3, >= 3.3.3)
|
||||
tzinfo-data
|
||||
wdm (~> 0.1.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.2
|
|
@ -0,0 +1,65 @@
|
|||
###
|
||||
# Page options, layouts, aliases and proxies
|
||||
###
|
||||
|
||||
# Per-page layout changes:
|
||||
#
|
||||
# With no layout
|
||||
page "/*.xml", layout: false
|
||||
page "/*.json", layout: false
|
||||
page "/*.txt", layout: false
|
||||
|
||||
# With alternative layout
|
||||
# page "/path/to/file.html", layout: :otherlayout
|
||||
|
||||
# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
|
||||
# proxy "/this-page-has-no-template.html", "/template-file.html", locals: {
|
||||
# which_fake_page: "Rendering a fake page with a local variable" }
|
||||
|
||||
###
|
||||
# Helpers
|
||||
###
|
||||
|
||||
activate :blog do |blog|
|
||||
# This will add a prefix to all links, template references and source paths
|
||||
# blog.prefix = "blog"
|
||||
|
||||
# blog.permalink = "{year}/{month}/{day}/{title}.html"
|
||||
# Matcher for blog source files
|
||||
# blog.sources = "{year}-{month}-{day}-{title}.html"
|
||||
# blog.taglink = "tags/{tag}.html"
|
||||
# blog.layout = "layout"
|
||||
# blog.summary_separator = /(READMORE)/
|
||||
# blog.summary_length = 250
|
||||
# blog.year_link = "{year}.html"
|
||||
# blog.month_link = "{year}/{month}.html"
|
||||
# blog.day_link = "{year}/{month}/{day}.html"
|
||||
# blog.default_extension = ".markdown"
|
||||
|
||||
blog.tag_template = "tag.html"
|
||||
blog.calendar_template = "calendar.html"
|
||||
|
||||
# Enable pagination
|
||||
# blog.paginate = true
|
||||
# blog.per_page = 10
|
||||
# blog.page_link = "page/{num}"
|
||||
end
|
||||
|
||||
page "/feed.xml", layout: false
|
||||
# Reload the browser automatically whenever files change
|
||||
configure :development do
|
||||
activate :livereload
|
||||
end
|
||||
|
||||
# Methods defined in the helpers block are available in templates
|
||||
helpers do
|
||||
def some_helper
|
||||
"Helping"
|
||||
end
|
||||
end
|
||||
|
||||
# Build-specific configuration
|
||||
configure :build do
|
||||
activate :minify_css
|
||||
activate :minify_javascript
|
||||
end
|
|
@ -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!
|
|
@ -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 %>
|
|
@ -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
|
|
@ -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 %>
|
|
@ -0,0 +1,40 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=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>
|
|
@ -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 %>
|
Loading…
Reference in New Issue