Skip to content

Commit 1df5898

Browse files
committed
Add markup, link checkers (resolve #14)
1 parent c6b5ac4 commit 1df5898

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

‎Gemfile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ gem 'travis'
99
gem 'rack-jekyll'
1010
gem 'rack-rewrite'
1111
gem 'rack-protection'
12+
13+
group :development do
14+
gem 'spidr', '~> 0.4'
15+
gem 'validate-website', '~> 0.9'
16+
end

‎Gemfile.lock‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ GEM
4848
rb-kqueue (>= 0.2)
4949
maruku (0.7.0)
5050
method_source (0.8.2)
51+
mini_portile (0.6.1)
5152
multi_json (1.10.1)
5253
multipart-post (2.0.0)
54+
multipart_body (0.2.1)
5355
net-http-persistent (2.9.4)
5456
net-http-pipeline (1.0.1)
57+
nokogiri (1.6.5)
58+
mini_portile (~> 0.6.0)
59+
paint (0.9.0)
5560
parslet (1.5.0)
5661
blankslate (~> 2.0)
5762
posix-spawn (0.3.9)
@@ -81,6 +86,8 @@ GEM
8186
redcarpet (2.3.0)
8287
safe_yaml (1.0.4)
8388
slop (3.6.0)
89+
spidr (0.4.1)
90+
nokogiri (~> 1.3)
8491
toml (0.1.2)
8592
parslet (~> 1.5.0)
8693
travis (1.7.4)
@@ -96,6 +103,10 @@ GEM
96103
typhoeus (~> 0.6, >= 0.6.8)
97104
typhoeus (0.6.9)
98105
ethon (>= 0.7.1)
106+
validate-website (0.9.5)
107+
multipart_body (~> 0.2)
108+
paint (~> 0.8)
109+
spidr (~> 0.4)
99110
websocket (1.2.1)
100111
yajl-ruby (1.1.0)
101112

@@ -109,4 +120,6 @@ DEPENDENCIES
109120
rack-protection
110121
rack-rewrite
111122
rake (~> 10.0)
123+
spidr (~> 0.4)
112124
travis
125+
validate-website (~> 0.9)

‎Rakefile‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,23 @@ task :release do
5555
sh "git push origin gh-pages"
5656
end
5757
end
58+
59+
namespace :check do
60+
desc 'validate _site markup with validate-website'
61+
task :markup => :generate do
62+
options = Jekyll.configuration({'auto' => false, 'server' => false})
63+
Dir.chdir('_site') do
64+
system("validate-website-static --site '#{options['url']}/' --quiet")
65+
exit($?.exitstatus)
66+
end
67+
end
68+
desc "Checks for broken links on http://0.0.0.0:4000/"
69+
task :links do
70+
require 'spidr'
71+
Spidr.start_at('http://0.0.0.0:4000/') do |agent|
72+
agent.every_failed_url do |url|
73+
puts "Broken link #{url} found."
74+
end
75+
end
76+
end
77+
end

0 commit comments

Comments
 (0)