Skip to content

Commit

Permalink
Initial commit of blog
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdavey committed Nov 26, 2014
1 parent 1e9510a commit e7338e3
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 66 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
# Ignore the build directory
/build

# Ignore Sass' cache
# Ignore cache
/.sass-cache
/.cache

# Ignore .DS_store file
.DS_Store
95 changes: 84 additions & 11 deletions config.rb
Original file line number Diff line number Diff line change
@@ -1,30 +1,103 @@
###
# Blog settings
###

set :css_dir, 'css'
# Time.zone = "UTC"

set :js_dir, 'js'
activate :blog do |blog|
# This will add a prefix to all links, template references and source paths
# blog.prefix = "blog"

set :images_dir, 'img'
# 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

###
# Compass
###

# Change Compass configuration
# compass_config do |config|
# config.output_style = :compact
# end

###
# Page options, layouts, aliases and proxies
###

# Per-page layout changes:
#
# With no layout
# page "/path/to/file.html", layout: false
#
# With alternative layout
# page "/path/to/file.html", layout: :otherlayout
#
# A path which all have the same layout
# with_layout :admin do
# page "/admin/*"
# end

# 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
###

# Automatic image dimensions on image_tag helper
# activate :automatic_image_sizes

# Reload the browser automatically whenever files change
# activate :livereload

# Methods defined in the helpers block are available in templates
# helpers do
# def some_helper
# "Helping"
# end
# end

set :css_dir, 'stylesheets'

set :js_dir, 'javascripts'

set :images_dir, 'images'

# Build-specific configuration
configure :build do
# For example, change the Compass output style for deployment
activate :minify_css
# activate :minify_css

# Minify Javascript on build
activate :minify_javascript
# activate :minify_javascript

# Enable cache buster
activate :asset_hash
# activate :asset_hash

# Use relative URLs
# activate :relative_assets

# Or use a different image path
# set :http_prefix, "/Content/images/"
end

activate :deploy do |deploy|
deploy.method = :git
deploy.branch = "master"
end
7 changes: 7 additions & 0 deletions source/2012-01-01-example-article.html.markdown
Original file line number Diff line number Diff line change
@@ -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 changes: 33 additions & 0 deletions source/calendar.html.erb
Original file line number Diff line number Diff line change
@@ -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 changes: 24 additions & 0 deletions source/feed.xml.builder
Original file line number Diff line number Diff line change
@@ -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
73 changes: 19 additions & 54 deletions source/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,59 +1,24 @@
---
title: Ruby Meetup Resources
pageable: true
per_page: 10
---
<% if paginate && num_pages > 1 %>
<p>Page <%= page_number %> of <%= num_pages %></p>

<section id="home" class="jumbotron">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h1>Ruby Meetup Resources</h1>
<p>Help for running a ruby meetup.</p>
</div>
</div>
</div>
</section>
<% if prev_page %>
<p><%= link_to 'Previous page', prev_page %></p>
<% end %>
<% end %>

<div class="container">
<div class="row">
<div class="col-md-offset-3 col-md-6">
<h1>Welcome</h1>
<p>Running a meetup can be quite a lot of effort. We thought it would be great
to make it easier for meetups to share resources which they've created, which could
be used by other meetups. So far there are just a couple of resources, but we
are hopeful this list will grow, especially with your support.</p>
<% 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 %>

<p>You can browse a list of the resources at <a href="https://github.com/ruby-meetup-resources">https://github.com/ruby-meetup-resources</a>.
If you have a contribution to make, please just open an issue on <a href="https://github.com/ruby-meetup-resources/new-resources">https://github.com/ruby-meetup-resources/new-resources</a>

<p>Finally, please tweet, mail your friends, and generally help get the word out there!</p>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<h2>Contribution Guidelines</h2>
<p>Ideally we are looking for <b>hack night / game resources</b>. While we do have a <a href="./beginner_resources">list of beginner Ruby resources</a>,
ideally we are looking for things which are:</p>
<ol>
<li><b>Ready to go.</b>.<br/>There shouldn't be too much configuration required to get the resource running. Otherwise it's not making your life easier ;)</li>
<li><b>Have a collaboration / team / game environment.</b>.<br/>There are lots of great resources out there for coding challeges etc (some listed on the
beginner page), but what we're looking for is something "fun", like the robotwars, or a scoreboard for some sort of coding challenge type event. Well, that's the ideal
anyway, but sure it's all up for debate, and if you have something to contribute or a different idea, please, <a href="https://github.com/ruby-meetup-resources/new-resources">add your idea</a>
</ol>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<h2>Current Resources</h2>
<ul>
<li><a href="https://github.com/ruby-meetup-resources/rubywarrior_scoreboard">A scoreboard for ruby-warrior</a>(and associated <a href="https://github.com/ruby-meetup-resources/scoreboard_rubywarrior">gem</a>)<br/>This website &amp; gem wrap the excellent ruby-warrior (by Ryan Bates), with the ability to share code and scores between particpants. Easy to fork and setup your own internal competition, and a great way for new rubyists to play with the language and learn from peers</li>
<li><a href="https://github.com/ruby-meetup-resources/robotwars">Robotwars</a><br/>
This repo is just a basic setup for using the rrobots gem to run a run simulation where you drive AI tanks around. You need to provide your own server (but having a repo where people can push their tanks is probably enough<br/>
<iframe width="560" height="315" src="//www.youtube.com/embed/GceXQZiKQig" frameborder="0" allowfullscreen></iframe></li>
</ul>
</div>
</div>
</div>
<% if paginate %>
<% if next_page %>
<p><%= link_to 'Next page', next_page %></p>
<% end %>
<% end %>
38 changes: 38 additions & 0 deletions source/layout.erb
Original file line number Diff line number Diff line change
@@ -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 changes: 25 additions & 0 deletions source/tag.html.erb
Original file line number Diff line number Diff line change
@@ -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 %>

0 comments on commit e7338e3

Please sign in to comment.