-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathRakefile
More file actions
49 lines (42 loc) · 1022 Bytes
/
Rakefile
File metadata and controls
49 lines (42 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'time'
require 'rake-jekyll'
require 'html/proofer'
desc 'create a new draft post'
task :new do
title = ENV['title']
if title.nil?
puts 'A title is required. Usage: rake post title="Your Title"'
else
file = File.join(
File.dirname(__FILE__),
'_posts/' +
Date.today.to_s + '-' + title.downcase.gsub(/[^\w]+/, '-') + '.md'
)
File.open(file, "w") do |f|
f << <<-EOS.gsub(/^ /, '')
---
layout: post
title: #{title}
published: false
categories: blog
---
EOS
end
end
end
Rake::Jekyll::GitDeployTask.new(:deploy) do |t|
t.deploy_branch = 'master'
# Run this command to build the site.
t.jekyll_build = ->(dest_dir) {
Rake.sh "bundle exec jekyll build --destination #{dest_dir}"
HTML::Proofer.new(dest_dir, {
:href_ignore => [
"#"
],
:alt_ignore => [
/gc_button1_en/
],
:only_4xx=> true
}).run
}
end