Skip to content

Commit

Permalink
Fix SSL issues, Fix pagination issues, Improve Rakefile
Browse files Browse the repository at this point in the history
* Fix SSL issues in TravisCI: gjtorikian/html-proofer#376 (comment)
* Update html-proofer version
* Update Rakefile options used for html-proofer
* Fix pagination linking failure
  • Loading branch information
joshmfrankel committed Nov 29, 2018
1 parent c94ed9d commit bcd9389
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 29 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
language: ruby
rvm:
- 2.3.1

env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer

addons:
apt:
packages:
- libcurl4-openssl-dev # required to avoid SSL errors

install:
- bundle install
deploy:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ruby RUBY_VERSION

gem "rake", "~> 12"
gem "jekyll"
gem "html-proofer"
gem "html-proofer", "3.9.0"

group :jekyll_plugins do
gem "jekyll-feed"
Expand Down
41 changes: 21 additions & 20 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.3)
activesupport (5.2.1.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
colored (1.2)
concurrent-ruby (1.0.5)
ethon (0.10.1)
colorize (0.8.1)
concurrent-ruby (1.1.3)
ethon (0.11.0)
ffi (>= 1.3.0)
ffi (1.9.18)
forwardable-extended (2.6.0)
html-proofer (3.7.2)
html-proofer (3.9.0)
activesupport (>= 4.2, < 6.0)
addressable (~> 2.3)
colored (~> 1.2)
colorize (~> 0.8)
mercenary (~> 0.3.2)
nokogiri (~> 1.7)
nokogiri (~> 1.8.1)
parallel (~> 1.3)
typhoeus (~> 0.7)
typhoeus (~> 1.3)
yell (~> 2.0)
i18n (0.8.6)
i18n (1.1.1)
concurrent-ruby (~> 1.0)
jekyll (3.5.2)
addressable (~> 2.4)
colorator (~> 1.0)
Expand Down Expand Up @@ -58,11 +59,11 @@ GEM
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.2.0)
minitest (5.10.3)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
parallel (1.12.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
parallel (1.12.1)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
Expand All @@ -78,17 +79,17 @@ GEM
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
thread_safe (0.3.6)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.3)
typhoeus (1.3.1)
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
yell (2.0.7)

PLATFORMS
ruby

DEPENDENCIES
html-proofer
html-proofer (= 3.9.0)
jekyll
jekyll-compose (~> 0.5)
jekyll-feed
Expand All @@ -102,4 +103,4 @@ RUBY VERSION
ruby 2.4.2p198

BUNDLED WITH
1.15.4
1.16.1
16 changes: 15 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,23 @@ require "html-proofer"
task :default do
puts "Running CI tasks..."
sh("JEKYLL_ENV=production bundle exec jekyll build")

options = {
# @todo Should try to enable this one
# https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
check_sri: false,
check_opengraph: true,
check_favicon: false, # @todo I should add a favicon
http_status_ignore: [999],
url_ignore: [/globalnerdy.com.*/],
cache: {
timeframe: '6w'
}
}

HTMLProofer.check_directory(
"./_site",
url_ignore: [/linkedin.com|php-fig.org|bower.io|bost.ocks.org|elementary.io|jonathan-petitcolas.com|jameswheaton.me|globalnerdy.com|leehblue.com#.*/] # Hidden behind auth wall
options
).run
puts "Jekyll successfully built"
end
8 changes: 1 addition & 7 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<section class="Listing">
{% comment %}@todo There's got to be a better way here{% endcomment %}
{% if jekyll.environment == "production" %}
{% assign current_url = "http://joshfrankel.me/blog/" %}
{% else %}
{% assign current_url = "http://localhost:4000/blog/" %}
{% endif %}
<!-- This loops through the paginated posts -->
{% for post in paginator.posts %}
<article class="Listing Listing-article">
<h1 class="Listing Listing-title"><a href="{{ post.url }}">{{ post.title }}</a></h1>
<h2 class="Listing Listing-category"><em>posted in <a href="{{ current_url | append: "categories#" | append: post.categories.first }}">{{ post.categories.first | replace: '-', ' ' }}</a></em></h2>
<h2 class="Listing Listing-category"><em>posted in <a href="{{ "/blog/categories#" | append: post.categories.first }}">{{ post.categories.first | replace: '-', ' ' }}</a></em></h2>

<p class="Listing Listing-date">
<i class="fa fa-calendar" aria-hidden="true"></i>&nbsp;<time datetime="{{ post.date | date: '%Y-%m-%d' }}">{{ post.date | date: "%B %-d, %Y" }}</time>
Expand Down

0 comments on commit bcd9389

Please sign in to comment.