Skip to content

Commit 356d626

Browse files
committed
started on intro post, added rake helpers
1 parent 788cbd8 commit 356d626

9 files changed

Lines changed: 318 additions & 12 deletions

File tree

_posts/2011-12-31-introduction.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
layout: post
3+
title: "An introduction to code52"
4+
---
5+
6+

_site/atom.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@
33
<title>Code52</title>
44
<link href="http://www.Code52.org/"/>
55
<link type="application/atom+xml" rel="self" href="http://www.Code52.org/atom.xml"/>
6-
<updated>2011-12-14T14:55:27+11:00</updated>
6+
<updated>2011-12-16T13:15:43+11:00</updated>
77
<id>http://www.Code52.org/</id>
88
<author>
99
<name>Code52 Team</name>
1010
<email>Code52@Code52.org</email>
1111
</author>
1212

1313

14+
<entry>
15+
<id>http://www.Code52.org//introduction</id>
16+
<link type="text/html" rel="alternate" href="http://www.Code52.org//introduction.html"/>
17+
<title>An introduction to code52</title>
18+
<updated>2011-12-31T00:00:00+11:00</updated>
19+
<author>
20+
<name>Code52 Team</name>
21+
<uri>http://www.Code52.org/</uri>
22+
</author>
23+
<content type="html">
24+
</content>
25+
</entry>
26+
1427
<entry>
1528
<id>http://www.Code52.org//idea1</id>
1629
<link type="text/html" rel="alternate" href="http://www.Code52.org//idea1.html"/>

_site/idea1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h1> Idea 1: Cupcake ipsum dolor sit amet marshmallow. </h1>
3939
</div>
4040
<div id="page-navigation">
4141
<div class="left"> </div>
42-
<div class="right"> </div>
42+
<div class="right"> <a href="/introduction" title="next Post: An introduction to code52">An introduction to code52 &rarr; </a> </div>
4343
<div class="clear">&nbsp;</div>
4444
</div>
4545

_site/index.html

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,33 @@
2525
<li>
2626
<div class="idea">
2727

28-
<h1><a href="/idea1">Idea 1: Cupcake ipsum dolor sit amet marshmallow.</a></h1>
28+
<h1><a href="/introduction">An introduction to code52</a></h1>
2929

30-
<div class="postdate">14 December, 2011
30+
<div class="postdate">31 December, 2011
3131
<ul>
3232

3333
</ul>
3434
</div>
3535

36-
<p>Chocolate bear claw I love. Cotton candy sesame snaps gingerbread chocolate. Candy toffee sweet gummi bears cheesecake chocolate bar cotton candy tart danish. I love I love I love I love sweet I love lollipop I love. Pudding ice cream halvah muffin chupa chups powder. Pie chocolate cake donut ice cream jelly ice cream macaroon topping sesame snaps. Ice cream I love jujubes applicake sweet roll liquorice. Pastry icing biscuit faworki. Chocolate bar cupcake cupcake soufflé I love. Macaroon chupa chups I love chocolate bar candy canes wafer jelly sweet tiramisu. Sesame snaps fruitcake chocolate donut sweet tiramisu. Jelly beans pastry applicake powder marzipan I love.</p>
37-
38-
<p>Candy canes chocolate bar fruitcake I love candy oat cake. I love halvah brownie pastry. Cheesecake gingerbread tart marshmallow tootsie roll cheesecake. Wafer sugar plum liquorice caramels sweet tiramisu liquorice faworki topping. Tootsie roll carrot cake I love jelly beans candy pastry pudding sesame snaps pudding. Toffee candy biscuit dessert tiramisu topping chupa chups danish. Sweet liquorice lemon drops. Brownie cotton candy chocolate cake halvah croissant cheesecake bear claw cheesecake. Cheesecake jelly beans tiramisu I love chocolate jelly-o cookie. Chupa chups sugar plum macaroon pudding donut chupa chups gummies. Cheesecake lollipop oat cake wafer carrot cake. Sweet roll I love applicake lollipop.
39-
Cupcake I love halvah. Jelly beans chocolate cake cake. Oat cake pudding pudding dragée. Soufflé I love lollipop dragée danish. Sweet brownie biscuit wafer. I love pie jelly croissant jujubes. Dragée I love candy canes. Pastry bonbon macaroon soufflé pastry tootsie roll faworki. Sesame snaps liquorice pie gummi bears. I love gummi bears sesame snaps gummi bears chupa chups applicake. Gingerbread candy canes pudding. Cookie faworki jelly muffin chupa chups macaroon. Sugar plum bonbon I love bear claw. Marzipan toffee bonbon marzipan carrot cake.</p>
40-
41-
<p>sugar plum toffee. I love tart jelly-o halvah ice cream. Biscuit fruitcake marshmallow biscuit. Apple pie fruitcake ice cream fruitcake icing. Toffee cotton candy macaroon danish. I love jelly beans halvah gummi bears oat cake chupa chups brownie. Muffin brownie applicake marzipan gummies.</p>
36+
4237

4338
<br />
39+
<a href="/introduction#disqus_thread">Comments</a>
40+
41+
</div>
42+
</li>
43+
44+
<li>
45+
<div class="idea">
46+
47+
<h3><a class="postlink" href="/idea1">Idea 1: Cupcake ipsum dolor sit amet marshmallow.</a></h3>
48+
<div class="postdate">14 December, 2011
49+
<ul>
50+
51+
</ul>
52+
</div>
53+
54+
4455
<a href="/idea1#disqus_thread">Comments</a>
4556

4657
</div>

_site/introduction.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta content="en-au" http-equiv="Content-Language" />
5+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
6+
<link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Blog Feed" />
7+
<link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Blog Feed" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
9+
<title>Code52</title>
10+
<link rel="stylesheet" type="text/css" href="/css/style.css" />
11+
</head>
12+
<body>
13+
<div id="container">
14+
<div id="side">
15+
<a href="/" id="homelink" title="home" alt="home"><img src="/img/logo.png" alt="Code 52 - a new coding project every week" /></a>
16+
<ul>
17+
<li><a href="/about">about</a></li>
18+
<li><a href="http://code52.uservoice.com">submit an idea</a></li>
19+
<li><a href="#">past ideas</a></li>
20+
</ul>
21+
</div>
22+
<div id="content">
23+
<div class="entry-container">
24+
<div class='entry'>
25+
<h1> An introduction to code52 </h1>
26+
<span class="postdate">31 December, 2011
27+
28+
29+
<a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-via="code52org">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
30+
</span>
31+
32+
33+
</div>
34+
</div>
35+
<div id="page-navigation">
36+
<div class="left"> <a href="/idea1" title="Previous Post: Idea 1: Cupcake ipsum dolor sit amet marshmallow.">&larr; Idea 1: Cupcake ipsum dolor sit amet marshmallow.</a> </div>
37+
<div class="right"> </div>
38+
<div class="clear">&nbsp;</div>
39+
</div>
40+
41+
<div id="disqus_thread"></div>
42+
<script type="text/javascript">
43+
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
44+
var disqus_shortname = 'code52'; // required: replace example with your forum shortname
45+
46+
/* * * DON'T EDIT BELOW THIS LINE * * */
47+
(function() {
48+
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
49+
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
50+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
51+
})();
52+
</script>
53+
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
54+
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
55+
</div>
56+
57+
</div>
58+
</body>
59+
</html>

_site/rakefile.rb

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#Derived from https://github.com/avdgaag/arjanvandergaag.nl/blob/28539bc736a05b28f2aa4ef81e4f61f3f91375a0/Rakefile
2+
task :default => :dev
3+
4+
MY_URL = "http://www.brendanforster.com"
5+
MY_NAME = "Brendan Forster"
6+
7+
desc 'Ping pingomatic'
8+
task :ping do
9+
begin
10+
require 'xmlrpc/client'
11+
puts '* Pinging ping-o-matic'
12+
XMLRPC::Client.new('rpc.pingomatic.com', '/').call('weblogUpdates.extendedPing', MY_NAME , MY_URL, MY_URL + '/rss.xml')
13+
rescue LoadError
14+
puts '! Could not ping ping-o-matic, because XMLRPC::Client could not be found.'
15+
end
16+
end
17+
18+
desc 'Notify Google of the new sitemap'
19+
task :sitemap do
20+
begin
21+
require 'net/http'
22+
require 'uri'
23+
puts '* Pinging Google about our sitemap'
24+
Net::HTTP.get('www.google.com', '/webmasters/tools/ping?sitemap=' + URI.escape(MY_URL + '/sitemap.xml'))
25+
rescue LoadError
26+
puts '! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found.'
27+
end
28+
end
29+
30+
desc 'Run Jekyll in development mode'
31+
task :dev do
32+
puts '* Running Jekyll with auto-generation and server'
33+
puts `jekyll --auto --server`
34+
end
35+
36+
desc 'Run Jekyll to generate the site'
37+
task :build do
38+
puts '* Generating static site with Jekyll'
39+
puts `jekyll`
40+
end
41+
42+
desc 'Push source code to Github'
43+
task :push do
44+
puts '* Pushing to Github'
45+
puts `git push github master`
46+
47+
puts '* Pushing to heroku'
48+
puts `git push heroku master`
49+
end
50+
51+
desc 'Generate and publish the entire site, and send out pings'
52+
task :publish => [:build, :push, :sitemap, :ping] do
53+
end
54+
55+
desc 'create new post or bit. args: type (post, bit), title, future (# of days)'
56+
# rake new type=(bit|post) future=0 title="New post title goes here" slug="slug-override-title"
57+
task :new do
58+
require 'rubygems'
59+
require 'chronic'
60+
61+
type = ENV["type"] || "bit"
62+
title = ENV["title"] || "New Title"
63+
future = ENV["future"] || 0
64+
slug = ENV["slug"].gsub(' ','-').downcase || title.gsub(' ','-').downcase
65+
66+
if type == "bit"
67+
TARGET_DIR = "_bits"
68+
elsif future.to_i < 3
69+
TARGET_DIR = "_posts"
70+
else
71+
TARGET_DIR = "_drafts"
72+
end
73+
74+
if future.to_i.zero?
75+
filename = "#{Time.new.strftime('%Y-%m-%d')}-#{slug}.markdown"
76+
else
77+
stamp = Chronic.parse("in #{future} days").strftime('%Y-%m-%d')
78+
filename = "#{stamp}-#{slug}.markdown"
79+
end
80+
path = File.join(TARGET_DIR, filename)
81+
post = <<-HTML
82+
---
83+
layout: TYPE
84+
title: "TITLE"
85+
date: DATE
86+
---
87+
88+
HTML
89+
post.gsub!('TITLE', title).gsub!('DATE', Time.new.to_s).gsub!('TYPE', type)
90+
File.open(path, 'w') do |file|
91+
file.puts post
92+
end
93+
puts "new #{type} generated in #{path}"
94+
system "open -a textmate #{path}"
95+
end

_site/readme.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
Links
3+
4+
- http://code52.org/ -- main landing page
5+
- http://52co.de/ -- URL shortener
6+
- http://code52.uservoice.com/ -- suggestions and voting
7+
8+
9+
Random slogans:
10+
11+
- "new coding every week"
12+
- "coding fun and games"
13+
- "crowdsourcing software projects"
14+
- add your own
15+
16+
17+

_site/rss.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@
66
<atom:link href="http://www.Code52.org/rss.xml" rel="self" type="application/rss+xml" />
77
<description></description>
88
<language>en-au</language>
9-
<pubDate>Wed, 14 Dec 2011 14:55:27 +1100</pubDate>
10-
<lastBuildDate>Wed, 14 Dec 2011 14:55:27 +1100</lastBuildDate>
9+
<pubDate>Fri, 16 Dec 2011 13:15:43 +1100</pubDate>
10+
<lastBuildDate>Fri, 16 Dec 2011 13:15:43 +1100</lastBuildDate>
1111

1212

13+
<item>
14+
<title>An introduction to code52</title>
15+
<link>http://www.Code52.org/introduction.html</link>
16+
<pubDate>Sat, 31 Dec 2011 00:00:00 +1100</pubDate>
17+
<author>code52@code52.org (Code52 Team)</author>
18+
<guid>http://www.Code52.org/introduction</guid>
19+
<description>
20+
</description>
21+
</item>
22+
1323
<item>
1424
<title>Idea 1: Cupcake ipsum dolor sit amet marshmallow.</title>
1525
<link>http://www.Code52.org/idea1.html</link>

rakefile.rb

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#Derived from https://github.com/avdgaag/arjanvandergaag.nl/blob/28539bc736a05b28f2aa4ef81e4f61f3f91375a0/Rakefile
2+
task :default => :dev
3+
4+
MY_URL = "http://www.brendanforster.com"
5+
MY_NAME = "Brendan Forster"
6+
7+
desc 'Ping pingomatic'
8+
task :ping do
9+
begin
10+
require 'xmlrpc/client'
11+
puts '* Pinging ping-o-matic'
12+
XMLRPC::Client.new('rpc.pingomatic.com', '/').call('weblogUpdates.extendedPing', MY_NAME , MY_URL, MY_URL + '/rss.xml')
13+
rescue LoadError
14+
puts '! Could not ping ping-o-matic, because XMLRPC::Client could not be found.'
15+
end
16+
end
17+
18+
desc 'Notify Google of the new sitemap'
19+
task :sitemap do
20+
begin
21+
require 'net/http'
22+
require 'uri'
23+
puts '* Pinging Google about our sitemap'
24+
Net::HTTP.get('www.google.com', '/webmasters/tools/ping?sitemap=' + URI.escape(MY_URL + '/sitemap.xml'))
25+
rescue LoadError
26+
puts '! Could not ping Google about our sitemap, because Net::HTTP or URI could not be found.'
27+
end
28+
end
29+
30+
desc 'Run Jekyll in development mode'
31+
task :dev do
32+
puts '* Running Jekyll with auto-generation and server'
33+
puts `jekyll --auto --server`
34+
end
35+
36+
desc 'Run Jekyll to generate the site'
37+
task :build do
38+
puts '* Generating static site with Jekyll'
39+
puts `jekyll`
40+
end
41+
42+
desc 'Push source code to Github'
43+
task :push do
44+
puts '* Pushing to Github'
45+
puts `git push github master`
46+
47+
puts '* Pushing to heroku'
48+
puts `git push heroku master`
49+
end
50+
51+
desc 'Generate and publish the entire site, and send out pings'
52+
task :publish => [:build, :push, :sitemap, :ping] do
53+
end
54+
55+
desc 'create new post or bit. args: type (post, bit), title, future (# of days)'
56+
# rake new type=(bit|post) future=0 title="New post title goes here" slug="slug-override-title"
57+
task :new do
58+
require 'rubygems'
59+
require 'chronic'
60+
61+
type = ENV["type"] || "bit"
62+
title = ENV["title"] || "New Title"
63+
future = ENV["future"] || 0
64+
slug = ENV["slug"].gsub(' ','-').downcase || title.gsub(' ','-').downcase
65+
66+
if type == "bit"
67+
TARGET_DIR = "_bits"
68+
elsif future.to_i < 3
69+
TARGET_DIR = "_posts"
70+
else
71+
TARGET_DIR = "_drafts"
72+
end
73+
74+
if future.to_i.zero?
75+
filename = "#{Time.new.strftime('%Y-%m-%d')}-#{slug}.markdown"
76+
else
77+
stamp = Chronic.parse("in #{future} days").strftime('%Y-%m-%d')
78+
filename = "#{stamp}-#{slug}.markdown"
79+
end
80+
path = File.join(TARGET_DIR, filename)
81+
post = <<-HTML
82+
---
83+
layout: TYPE
84+
title: "TITLE"
85+
date: DATE
86+
---
87+
88+
HTML
89+
post.gsub!('TITLE', title).gsub!('DATE', Time.new.to_s).gsub!('TYPE', type)
90+
File.open(path, 'w') do |file|
91+
file.puts post
92+
end
93+
puts "new #{type} generated in #{path}"
94+
system "open -a textmate #{path}"
95+
end

0 commit comments

Comments
 (0)