Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor

Showing 2 changed files with 20 additions and 9 deletions. Show diff stats Hide diff stats

  1. 13  README.md
  2. 16  Rakefile
13  README.md
Source Rendered
... ...
@@ -1,2 +1,11 @@
1  
-jekyll-blog-starter
2  
-===================
  1
+Jekyll Blog Starter
  2
+===================
  3
+
  4
+A starting point for creating a blog using Jekyll. Based on [Jekyll Boilerplate][jbp] by [necolas][] and [Jekyll Base][jb] by [danielmcgraw][] but includes certain things missing in them such as a site feed (atom.xml), an archives page, and a Rakefile to easily launch a Jekyll server or create new posts and pages.
  5
+
  6
+Also included is a very simple theme; feel free to use it as-is or modify it any way you like.
  7
+
  8
+[jbp]: https://github.com/necolas/jekyll-boilerplate
  9
+[necolas]: https://github.com/necolas
  10
+[jb]: https://github.com/danielmcgraw/Jekyll-Base
  11
+[danielmcgraw]: https://github.com/danielmcgraw
16  Rakefile
@@ -39,21 +39,23 @@ task :post do
39 39
   end
40 40
 end # task :post
41 41
 
42  
-# Usage: rake page title="about.html"
43  
-# You can also specify a sub-directory path.
44  
-# If you don't specify a file extention we create an index.html at the path specified
  42
+# Usage: rake page title="About"
  43
+# You can also specify a sub-directory path, e.g. rake page title='pages/About'
45 44
 desc "Create a new page."
  45
+
46 46
 task :page do
47  
-  title = ENV["title"] || "new-page.md"
48  
-  filename = File.join(SOURCE, "#{title}")
49  
-  filename = File.join(filename, "index.html") if File.extname(filename) == ""
50  
-  title = File.basename(filename, File.extname(filename)).gsub(/[\W\_]/, " ").gsub(/\b\w/){$&.upcase}
  47
+
  48
+  title = ENV['title'] || 'new page'
  49
+  filename = File.join(SOURCE, title.downcase.strip.gsub(/\s+/, '-'), 'index.md')
  50
+  title = File.basename(title)
  51
+
51 52
   if File.exist?(filename)
52 53
     abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n'
53 54
   end
54 55
 
55 56
   mkdir_p File.dirname(filename)
56 57
   puts "Creating new page: #{filename}"
  58
+
57 59
   open(filename, 'w') do |post|
58 60
     post.puts "---"
59 61
     post.puts "layout: page"

No commit comments for this range

Something went wrong with that request. Please try again.