Skip to content

Commit a03f13a

Browse files
committed
added html proofer to travis tests
1 parent 5422995 commit a03f13a

File tree

145 files changed

+263
-289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+263
-289
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
_site
22
.sass-cache
33
.jekyll-metadata
4+
tmp
45
Gemfile.lock
6+
_site-test

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: ruby
2+
rvm:
3+
- 2.1.4
4+
script: bundle exec rake test
5+
sudo: false
6+
env:
7+
global:
8+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
9+
notifications:
10+
slack:
11+
secure: aPSxTv5df576zSV9Sn+yLrp76EdK3yqSfvtTCWkaj3XNJPGpgUPMGC3XYKubPYnyjcbP7YAkXk2ui+aR9ipoN4Vb3r8rWa714lRK2mm3fbL+vqh8t9RZZK0Eqc77jvcmyvaJPEq8hAzJvavK4xDv+wL3sSqBFvqfBjsZfAw2G+1B4AGzlLVxmQh6VanFLCbi4s/7LvEE4CjrIKpt42cYRU46HOrxLmYBn6mYrvVv/zLlCM6i/7DOcuMz6weYZpjbsL/KRx65q3BM/GKnzzQB7oRfP4UXgsnJ1+xMTy1mlb7Tqf4TZQ15Mk/AL3zil7UxLbcAW6xG0OZ+yPtnayb8tgpdTJ3Yxa+EdD67h7bQH9F7y4bkeiHkBHJIx+4farFwq2eOcnN1Fu3P2nQwpEhWhaiFak2KpZUkm4J5qLGu1JU056go/hARlm4fEHq/mTVGjwgSMk1injpywuxkWtNH6wcBEluW66jcpPN0Dvc2u9hw1NUt9W5ZD4U/c21PMxPf/KsJ7EDBiQCibJNE9pHp9gfWi31o4pEj7niSNKlTFefQr+QXwbrCwvG/F2QvDT2PrxyFKsZo55yDk4OWZb+aCOVLPaAhpphmiUqqkKDtRNkxfAT+Y8Sh0+yvCx3mGx7idFADiWcAdq9QkRFBke4XnIHfcOYENxt+VMGPqEXy5gU=
12+
email:
13+
14+
branches:
15+
only:
16+
- gh-pages
17+
- /\S*/

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
22
gem 'github-pages'
33

44
# Test the build
5-
group :test do
5+
group :test, :development do
66
gem 'rake'
77
gem 'html-proofer'
88
end

Gemfile.lock

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
RedCloth (4.2.9)
5-
activesupport (4.2.5.1)
5+
activesupport (4.2.6)
66
i18n (~> 0.7)
77
json (~> 1.7, >= 1.7.7)
88
minitest (~> 5.1)
99
thread_safe (~> 0.3, >= 0.3.4)
1010
tzinfo (~> 1.1)
11-
addressable (2.3.8)
12-
coderay (1.1.0)
11+
addressable (2.4.0)
12+
coderay (1.1.1)
1313
coffee-script (2.4.1)
1414
coffee-script-source
1515
execjs
@@ -21,36 +21,37 @@ GEM
2121
http_parser.rb (~> 0.6.0)
2222
ethon (0.8.1)
2323
ffi (>= 1.3.0)
24-
eventmachine (1.0.9.1)
24+
eventmachine (1.2.0.1)
2525
execjs (2.6.0)
2626
faraday (0.9.2)
2727
multipart-post (>= 1.2, < 3)
2828
ffi (1.9.10)
2929
formatador (0.2.5)
3030
gemoji (2.1.0)
31-
github-pages (49)
31+
github-pages (68)
3232
RedCloth (= 4.2.9)
33-
github-pages-health-check (= 1.0.1)
33+
github-pages-health-check (= 1.1.0)
3434
jekyll (= 3.0.3)
3535
jekyll-coffeescript (= 1.0.1)
36-
jekyll-feed (= 0.3.1)
36+
jekyll-feed (= 0.4.0)
3737
jekyll-gist (= 1.4.0)
38-
jekyll-mentions (= 1.0.1)
38+
jekyll-github-metadata (= 1.10.0)
39+
jekyll-mentions (= 1.1.2)
3940
jekyll-paginate (= 1.1.0)
40-
jekyll-redirect-from (= 0.9.1)
41+
jekyll-redirect-from (= 0.10.0)
4142
jekyll-sass-converter (= 1.3.0)
42-
jekyll-seo-tag (= 1.0.0)
43+
jekyll-seo-tag (= 1.3.3)
4344
jekyll-sitemap (= 0.10.0)
4445
jekyll-textile-converter (= 0.1.0)
45-
jemoji (= 0.5.1)
46-
kramdown (= 1.9.0)
46+
jemoji (= 0.6.2)
47+
kramdown (= 1.10.0)
4748
liquid (= 3.0.6)
4849
mercenary (~> 0.3)
4950
rdiscount (= 2.1.8)
5051
redcarpet (= 3.3.3)
5152
rouge (= 1.10.1)
5253
terminal-table (~> 1.4)
53-
github-pages-health-check (1.0.1)
54+
github-pages-health-check (1.1.0)
5455
addressable (~> 2.3)
5556
net-dns (~> 0.8)
5657
octokit (~> 4.0)
@@ -74,7 +75,7 @@ GEM
7475
html-pipeline (2.3.0)
7576
activesupport (>= 2, < 5)
7677
nokogiri (>= 1.4)
77-
html-proofer (2.6.4)
78+
html-proofer (3.0.4)
7879
activesupport (~> 4.2)
7980
addressable (~> 2.3)
8081
colored (~> 1.2)
@@ -96,30 +97,32 @@ GEM
9697
safe_yaml (~> 1.0)
9798
jekyll-coffeescript (1.0.1)
9899
coffee-script (~> 2.2)
99-
jekyll-feed (0.3.1)
100+
jekyll-feed (0.4.0)
100101
jekyll-gist (1.4.0)
101102
octokit (~> 4.2)
102-
jekyll-mentions (1.0.1)
103+
jekyll-github-metadata (1.10.0)
104+
octokit (~> 4.0)
105+
jekyll-mentions (1.1.2)
103106
html-pipeline (~> 2.3)
104107
jekyll (~> 3.0)
105108
jekyll-paginate (1.1.0)
106-
jekyll-redirect-from (0.9.1)
109+
jekyll-redirect-from (0.10.0)
107110
jekyll (>= 2.0)
108111
jekyll-sass-converter (1.3.0)
109112
sass (~> 3.2)
110-
jekyll-seo-tag (1.0.0)
111-
jekyll (>= 2.0)
113+
jekyll-seo-tag (1.3.3)
114+
jekyll (~> 3.0)
112115
jekyll-sitemap (0.10.0)
113116
jekyll-textile-converter (0.1.0)
114117
RedCloth (~> 4.0)
115118
jekyll-watch (1.3.1)
116119
listen (~> 3.0)
117-
jemoji (0.5.1)
120+
jemoji (0.6.2)
118121
gemoji (~> 2.0)
119122
html-pipeline (~> 2.2)
120-
jekyll (>= 2.0)
123+
jekyll (>= 3.0)
121124
json (1.8.3)
122-
kramdown (1.9.0)
125+
kramdown (1.10.0)
123126
liquid (3.0.6)
124127
listen (3.0.6)
125128
rb-fsevent (>= 0.9.3)
@@ -138,25 +141,25 @@ GEM
138141
notiffany (0.0.8)
139142
nenv (~> 0.1)
140143
shellany (~> 0.0)
141-
octokit (4.2.0)
142-
sawyer (~> 0.6.0, >= 0.5.3)
143-
parallel (1.6.1)
144+
octokit (4.3.0)
145+
sawyer (~> 0.7.0, >= 0.5.3)
146+
parallel (1.8.0)
144147
pry (0.10.3)
145148
coderay (~> 1.1.0)
146149
method_source (~> 0.8.1)
147150
slop (~> 3.4)
148151
public_suffix (1.5.3)
149-
rake (10.5.0)
152+
rake (11.1.2)
150153
rb-fsevent (0.9.7)
151154
rb-inotify (0.9.7)
152155
ffi (>= 0.5.0)
153156
rdiscount (2.1.8)
154157
redcarpet (3.3.3)
155158
rouge (1.10.1)
156159
safe_yaml (1.0.4)
157-
sass (3.4.21)
158-
sawyer (0.6.0)
159-
addressable (~> 2.3.5)
160+
sass (3.4.22)
161+
sawyer (0.7.0)
162+
addressable (>= 2.3.5, < 2.5)
160163
faraday (~> 0.8, < 0.10)
161164
shellany (0.0.1)
162165
slop (3.6.0)

Rakefile

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ require 'rake'
44
require 'yaml'
55
require 'fileutils'
66
require 'rbconfig'
7-
require 'html/proofer'
7+
require 'html-proofer'
8+
require "csv"
89

910
# == Configuration =============================================================
1011

@@ -139,10 +140,10 @@ desc "Serve and watch the site (with post limit or drafts)"
139140
task :watch, :option do |t, args|
140141
option = args[:option]
141142
if option.nil? or option.empty?
142-
execute("jekyll serve --watch --baseurl ''")
143+
execute("jekyll serve --watch")
143144
else
144145
if option == "drafts"
145-
execute("jekyll serve --watch --drafts --baseurl ''")
146+
execute("jekyll serve --watch --drafts")
146147
else
147148
execute("jekyll serve --watch --baseurl '' --limit_posts #{option}")
148149
end
@@ -164,9 +165,60 @@ task :preview do
164165
Rake::Task[:watch].invoke
165166
end
166167

168+
169+
desc "Delete older files from _site-test before running html proofer"
170+
task :deleteOldFiles do
171+
sh 'rm -rf ./_site-test/blog/2008/ ./_site-test/blog/2009/ ./_site-test/blog/2010/ ./_site-test/blog/2011/ ./_site-test/blog/2012/ ./_site-test/blog/2013/ ./_site-test/blog/2014/ ./_site-test/blog/tag/phonegap-network/index.html'
172+
end
173+
174+
desc "Convert HTML Proof log to CSV"
175+
task :convertLog do
176+
filePath = './tmp/.htmlproofer/cache.log'
177+
if File.exists? filePath
178+
file = File.read(filePath)
179+
data_hash = JSON.parse(file)
180+
CSV.open("./tmp/.htmlproofer/log.csv", "wb") do |csv|
181+
csv << ['Url','File','Status','Message']
182+
data_hash.each do |attr_name, attr_value|
183+
if attr_value['status'] != 200
184+
data_array = [attr_name, attr_value['filenames'].join(","), attr_value['status'], attr_value['message']]
185+
csv << data_array
186+
end
187+
end
188+
end
189+
puts './tmp/.htmlproofer/log.csv' + ' written'
190+
else
191+
puts filePath + " not found"
192+
end
193+
end
194+
167195
# rake test
168196
desc "build and test website"
169197
task :test do
170198
sh "bundle exec jekyll build"
171-
HTML::Proofer.new("./_site", {:typhoeus => { :followlocation => true, :ssl_verifypeer => false, :headers => { 'User-Agent' => 'html-proofer' } }}).run
199+
HTMLProofer.check_directory("./_site", {
200+
:empty_alt_ignore => true,
201+
:url_ignore => [
202+
/\/app\/?/,
203+
/\/blog\/?/,
204+
'/book/',
205+
'/event/',
206+
'/getstarted/',
207+
'/products/',
208+
'/about/',
209+
'/about/faq/',
210+
'/about/license/',
211+
'/about/logos/',
212+
/\/getstarted\/?/,
213+
/\/products\/?/
214+
],
215+
:cache => {
216+
:timeframe => '1d'
217+
},
218+
:typhoeus => {
219+
:followlocation => true,
220+
:ssl_verifypeer => false,
221+
:headers => { 'User-Agent' => 'html-proofer' }
222+
}
223+
}).run
172224
end

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
title: Tools
22
description: Third party tools for working with PhoneGap
33
baseurl: "/tool" # the subpath of your site, e.g. /blog
4-
url: "http://phonegap.github.io" # the base hostname & protocol for your site
4+
url: "http://phonegap.com" # the base hostname & protocol for your site
55

66
gems: [jekyll-paginate]
77

_includes/head.html

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@
99
<script src="//use.typekit.net/exp7awb.js"></script>
1010
<script src="//assets.adobedtm.com/659ec8ada5450db95675e43beaaae92399591a11/satelliteLib-46e65db5bb0c375f8f64619be31cc9b29acf4867.js"></script>
1111
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
12-
<script src="/scripts/home.js"></script>
13-
<script src="/scripts/mobile_nav.js"></script>
12+
<script src="{{ "/scripts/home.js" | prepend: site.url }}"></script>
13+
<script src="{{ "/scripts/mobile_nav.js" | prepend: site.url }}"></script>
1414
{% for js_name in page.extra_js %}
1515
<script src="/scripts/{{ js_name }}"></script>
1616
{% endfor %}
17-
{% if jekyll.environment == "production" %}
18-
<link rel="stylesheet" type="text/css" href="{{ "/styles/main.css" | prepend: site.url }}"/>
19-
{% else %}
20-
<link rel="stylesheet" type="text/css" href="{{ "/styles/main.css" | prepend: site.baseurl | prepend: site.url }}"/>
21-
{% endif %}
17+
<link rel="stylesheet" type="text/css" href="{{ "/styles/main.css" | prepend: site.url }}"/>
2218
<style type="text/css">
2319
{% capture include_to_sassify %}{% include tool.sass %}{% endcapture %}
2420
{{ include_to_sassify | sassify }}

_posts/2010-12-04-easy-apns.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
permalink: /tool/easy-apns/
77
slug: easy-apns
88
status: publish
9-
thumb: /uploads/2010/02/easyaspns.png
9+
thumb: http://phonegap.com/uploads/2010/02/easyaspns.png
1010
title: Easy APNs
1111
type: tool
1212
format: html

_posts/2010-12-04-glovebox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
permalink: /tool/glovebox/
77
slug: glovebox
88
status: publish
9-
thumb: /uploads/2010/02/GloveBox88.png
9+
thumb: http://phonegap.com/uploads/2010/02/GloveBox88.png
1010
title: GloveBox
1111
type: tool
1212
format: html

_posts/2010-12-04-iscroll.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
permalink: /tool/iscroll/
77
slug: iscroll
88
status: publish
9-
thumb: /uploads/2010/02/iScroll.jpeg
9+
thumb: http://phonegap.com/uploads/2010/02/iScroll.jpeg
1010
title: iScroll
1111
type: tool
1212
format: html
1313
---
1414

15-
The overflow:scroll for mobile webkit. Project started because webkit for iPhone does not provide a native way to scroll content inside a fixed size (width/height) div.
15+
The overflow:scroll for mobile webkit. Project started because webkit for iPhone does not provide a native way to scroll content inside a fixed size (width/height) div.

0 commit comments

Comments
 (0)