From 44a2f5bb398292b04b5b75257dd5e86ee11e37cd Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Tue, 4 Apr 2017 13:44:47 -0400 Subject: [PATCH 1/9] Prepare site for newer Jekyll SEO Tag in a future relesae --- .rubocop.yml | 1 + Gemfile | 7 +--- Gemfile.lock | 40 ++++++++----------- _config.yml | 9 ++--- _includes/amp/post.html | 2 +- _includes/post-nav.html | 4 +- _layouts/post.html | 2 +- _pages/{contact.html => contact.md} | 0 ...9-22-restoring-vintage-with-3d-printing.md | 9 ++--- _posts/2015-04-11-transferring-n64-saves.md | 9 ++--- ...7-reverse-engineering-my-steelcase-desk.md | 11 +++-- ...17-making-a-book-from-facebook-messages.md | 9 ++--- ...-03-14-word-auto-journal-macro-for-lazy.md | 9 ++--- ...2016-03-15-easy-inline-usb-power-switch.md | 9 ++--- ...16-03-20-ios-video-bug-disclosure.markdown | 9 ++--- ...4-27-charma-gamifying-volunteer-process.md | 9 ++--- ...2016-04-29-testing-charma-with-selenium.md | 9 ++--- ...ocarina-of-time-n64-save-transfer-guide.md | 9 ++--- ...6-05-31-raspberry-pi-steam-vr-streaming.md | 9 ++--- ...nting-windows-application-notifications.md | 9 ++--- ...04-fixing-no-google-profile-for-contact.md | 9 ++--- ...17-01-04-backing-up-android-nougat-cats.md | 9 ++--- _posts/2017-02-22-improving-jekyll-2017.md | 9 ++--- 23 files changed, 88 insertions(+), 114 deletions(-) rename _pages/{contact.html => contact.md} (100%) diff --git a/.rubocop.yml b/.rubocop.yml index 2aa08abe5..b04f43d35 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,4 @@ AllCops: Exclude: - vendor/**/* # Ignore Travis-CI build directory + - node_modules/**/* # Ignore node modules directory diff --git a/Gemfile b/Gemfile index 3b15fc232..233bd8aec 100644 --- a/Gemfile +++ b/Gemfile @@ -8,16 +8,11 @@ gem 'jekyll-gist' gem 'jekyll-last-modified-at' gem 'jekyll-paginate' gem 'jekyll-redirect-from' +gem 'jekyll-seo-tag' gem 'jekyll-sitemap' gem 'nokogiri' gem 'rubocop' -group :jekyll_plugins do - git 'https://github.com/aav7fl/jekyll-seo-tag.git' do - gem 'jekyll-seo-tag', branch: 'testing' - end -end - # Test the build group :test do gem 'html-proofer' diff --git a/Gemfile.lock b/Gemfile.lock index e5c829449..2abfb4074 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,12 @@ -GIT - remote: https://github.com/aav7fl/jekyll-seo-tag.git - revision: 3410feec9784ced33f5f47e4b36cb3b6dc9f334b - specs: - jekyll-seo-tag (2.1.0) - jekyll (~> 3.3) - GEM remote: http://rubygems.org/ specs: - activesupport (5.0.1) + activesupport (5.0.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.0) + addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) amp-jekyll (1.0.1) fastimage (>= 1.8.0) @@ -22,16 +15,15 @@ GEM ast (2.3.0) colorator (1.1.0) colored (1.2) - concurrent-ruby (1.0.4) + concurrent-ruby (1.0.5) ethon (0.10.1) ffi (>= 1.3.0) - faraday (0.11.0) + faraday (0.12.0.1) multipart-post (>= 1.2, < 3) - fastimage (2.0.1) - addressable (~> 2) - ffi (1.9.17) + fastimage (2.1.0) + ffi (1.9.18) forwardable-extended (2.6.0) - html-proofer (3.4.0) + html-proofer (3.6.0) activesupport (>= 4.2, < 6.0) addressable (~> 2.3) colored (~> 1.2) @@ -41,7 +33,7 @@ GEM typhoeus (~> 0.7) yell (~> 2.0) i18n (0.8.1) - jekyll (3.4.0) + jekyll (3.4.3) addressable (~> 2.4) colorator (~> 1.0) jekyll-sass-converter (~> 1.0) @@ -52,7 +44,7 @@ GEM pathutil (~> 0.9) rouge (~> 1.7) safe_yaml (~> 1.0) - jekyll-feed (0.9.1) + jekyll-feed (0.9.2) jekyll (~> 3.3) jekyll-gist (1.4.0) octokit (~> 4.2) @@ -64,6 +56,8 @@ GEM jekyll (~> 3.3) jekyll-sass-converter (1.5.0) sass (~> 3.4) + jekyll-seo-tag (2.1.0) + jekyll (~> 3.3) jekyll-sitemap (1.0.0) jekyll (~> 3.3) jekyll-watch (1.5.0) @@ -77,11 +71,11 @@ GEM mini_portile2 (2.1.0) minitest (5.10.1) multipart-post (2.0.0) - nokogiri (1.7.0.1) + nokogiri (1.7.1) mini_portile2 (~> 2.1.0) octokit (4.6.2) sawyer (~> 0.8.0, >= 0.5.3) - parallel (1.10.0) + parallel (1.11.1) parser (2.4.0.0) ast (~> 2.2) pathutil (0.14.0) @@ -95,7 +89,7 @@ GEM rb-inotify (0.9.8) ffi (>= 0.5.0) rouge (1.11.1) - rubocop (0.47.1) + rubocop (0.48.1) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) @@ -107,10 +101,10 @@ GEM sawyer (0.8.1) addressable (>= 2.3.5, < 2.6) faraday (~> 0.8, < 1.0) - thread_safe (0.3.5) + thread_safe (0.3.6) typhoeus (0.8.0) ethon (>= 0.8.0) - tzinfo (1.2.2) + tzinfo (1.2.3) thread_safe (~> 0.1) unicode-display_width (1.1.3) yell (2.0.7) @@ -128,7 +122,7 @@ DEPENDENCIES jekyll-last-modified-at jekyll-paginate jekyll-redirect-from - jekyll-seo-tag! + jekyll-seo-tag jekyll-sitemap nokogiri rake diff --git a/_config.yml b/_config.yml index b506254a9..32883e91c 100644 --- a/_config.yml +++ b/_config.yml @@ -91,11 +91,10 @@ defaults: path: "" values: image: - default: - path: /assets/img/default-card.png - alt: Default-card - height: 400 - width: 700 + path: /assets/img/default-card.png + alt: Default-card + height: 400 + width: 700 - scope: path: _posts values: *post_val diff --git a/_includes/amp/post.html b/_includes/amp/post.html index 2bddd5c64..0a3b7e2aa 100644 --- a/_includes/amp/post.html +++ b/_includes/amp/post.html @@ -9,7 +9,7 @@

{{ page.date | date: '%B %d, %Y' }} | {{ page.content | number_ {% if page.image %}
- {{ page.image.default.alt }} + {{ page.image.alt }}
{% endif %} diff --git a/_includes/post-nav.html b/_includes/post-nav.html index c381adefa..f159ea186 100644 --- a/_includes/post-nav.html +++ b/_includes/post-nav.html @@ -4,7 +4,7 @@ {% if page.previous.image %} - Previous Article + Previous Article {% endif %} {% endif %} @@ -12,7 +12,7 @@ {% if page.next.image %} - Next Article + Next Article {% endif %} {% endif %} diff --git a/_layouts/post.html b/_layouts/post.html index a9511bb82..c8f265bd8 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -12,7 +12,7 @@

{{ page.content | number_of_words | divided_by:120 | ceil }} Mi {% if page.image %} - {{ page.image.default.alt }} + {{ page.image.alt }} {% endif %}
diff --git a/_pages/contact.html b/_pages/contact.md similarity index 100% rename from _pages/contact.html rename to _pages/contact.md diff --git a/_posts/2013-09-22-restoring-vintage-with-3d-printing.md b/_posts/2013-09-22-restoring-vintage-with-3d-printing.md index 004485b6e..941cd2450 100644 --- a/_posts/2013-09-22-restoring-vintage-with-3d-printing.md +++ b/_posts/2013-09-22-restoring-vintage-with-3d-printing.md @@ -3,11 +3,10 @@ title: Restoring Vintage with 3D Printing date: 2013-09-22 comments: true image: - default: - path: /assets/img/2013/09/small/DSC09139.JPG - alt: Marantz 2220B taken apart for upgrading parts - height: 532 - width: 800 + path: /assets/img/2013/09/small/DSC09139.JPG + alt: Marantz 2220B taken apart for upgrading parts + height: 532 + width: 800 tag: "large project" description: "Restoring my 1974 Marantz 2220B lamp housing with 3D printing. The old lamp house was brittle and broke from the incandescent bulb heat. I now use LEDs." redirect_from: "/blog/restoring-vintage-with-3d-printing/" diff --git a/_posts/2015-04-11-transferring-n64-saves.md b/_posts/2015-04-11-transferring-n64-saves.md index 6a15d0241..3827f5571 100644 --- a/_posts/2015-04-11-transferring-n64-saves.md +++ b/_posts/2015-04-11-transferring-n64-saves.md @@ -3,11 +3,10 @@ title: Transferring My N64 Saves date: "2015-04-11 16:41" comments: true image: - default: - path: /assets/img/2015/04/DSC09669.JPG - alt: 'N64 interfacing with The Legend of Zelda: Ocarina of Time to dump active memory' - height: 665 - width: 1000 + path: /assets/img/2015/04/DSC09669.JPG + alt: 'N64 interfacing with The Legend of Zelda: Ocarina of Time to dump active memory' + height: 665 + width: 1000 published: true tag: "large project" description: "How I extracted my N64 save files such as Mario party and Zelda Ocarina of Time by dumping the ram, calculating the checksum and building the sra save file" diff --git a/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md b/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md index a35da7657..29433d3dd 100644 --- a/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md +++ b/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md @@ -2,12 +2,11 @@ title: Discovering and Reverse Engineering My Steelcase Desk date: "2015-08-17 15:47" comments: true -image: - default: - path: /assets/img/2015/08/banner.jpg - alt: Steelcase height-adjustable standing desk - height: 779 - width: 800 +image: + path: /assets/img/2015/08/banner.jpg + alt: Steelcase height-adjustable standing desk + height: 779 + width: 800 published: true tag: "medium project" description: "How I reverse engineered the remote codes on my prototype Steelcase sit/stand desk unlocking secret developer codes to enable One Touch adjustments" diff --git a/_posts/2015-12-17-making-a-book-from-facebook-messages.md b/_posts/2015-12-17-making-a-book-from-facebook-messages.md index e6ba01890..caeea690e 100644 --- a/_posts/2015-12-17-making-a-book-from-facebook-messages.md +++ b/_posts/2015-12-17-making-a-book-from-facebook-messages.md @@ -3,11 +3,10 @@ title: Creating a Hardcover Book from a Plethora of Facebook Messages date: "2015-12-17 18:00" comments: true image: - default: - path: /assets/img/2015/12/banner.jpg - alt: Custom hardcover book composed of facebook chat messages - height: 814 - width: 1000 + path: /assets/img/2015/12/banner.jpg + alt: Custom hardcover book composed of facebook chat messages + height: 814 + width: 1000 published: true tag: "large project" description: "How I made a hardcover book for someone by downloading my Facebook message archive reversing the order of each 20,000 message segment for readability" diff --git a/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md b/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md index e4dc1b0e9..7a182644e 100644 --- a/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md +++ b/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md @@ -3,11 +3,10 @@ title: "Microsoft Word Auto-Journal Macro for the Lazy" date: "2016-03-14 16:19" comments: true image: - default: - path: /assets/img/2016/03/banner.png - alt: Microsoft Word output for auto journal macro - height: 505 - width: 964 + path: /assets/img/2016/03/banner.png + alt: Microsoft Word output for auto journal macro + height: 505 + width: 964 published: true tag: "small project" description: "I created a Microsoft Word macro that automatically generated a skeleton entry for today and added up the total hours documented thus far" diff --git a/_posts/2016-03-15-easy-inline-usb-power-switch.md b/_posts/2016-03-15-easy-inline-usb-power-switch.md index 464d6fe2b..906020497 100644 --- a/_posts/2016-03-15-easy-inline-usb-power-switch.md +++ b/_posts/2016-03-15-easy-inline-usb-power-switch.md @@ -3,11 +3,10 @@ title: "My Easy In-line USB Power Switch" date: "2016-03-15 20:25" comments: true image: - default: - path: /assets/img/2016/03/banner2.jpg - alt: Inline power switch on a USB cable - height: 603 - width: 800 + path: /assets/img/2016/03/banner2.jpg + alt: Inline power switch on a USB cable + height: 603 + width: 800 published: true tag: "small project" description: "How I added a rocker in-line power switch into my 10 foot USB 2.0 Type b cable. I referenced the USB 2.0 specifications to understand which wires to cut." diff --git a/_posts/2016-03-20-ios-video-bug-disclosure.markdown b/_posts/2016-03-20-ios-video-bug-disclosure.markdown index 5320e801d..43ce6e0d4 100644 --- a/_posts/2016-03-20-ios-video-bug-disclosure.markdown +++ b/_posts/2016-03-20-ios-video-bug-disclosure.markdown @@ -3,11 +3,10 @@ title: iOS Video Player Bug Disclosure date: '2016-03-20 18:05' comments: true image: - default: - path: /assets/img/2016/03/iPadTesting.jpg - alt: Testing iPad Air 2 colors with i1Display Pro colorimeter - height: 521 - width: 800 + path: /assets/img/2016/03/iPadTesting.jpg + alt: Testing iPad Air 2 colors with i1Display Pro colorimeter + height: 521 + width: 800 published: true tag: "large project" description: "A public disclosure that I discovered of an iOS video playback bug that decreases red and becomes washed out when user interface elements are hidden" diff --git a/_posts/2016-04-27-charma-gamifying-volunteer-process.md b/_posts/2016-04-27-charma-gamifying-volunteer-process.md index 087f1ced2..12b30b2a0 100644 --- a/_posts/2016-04-27-charma-gamifying-volunteer-process.md +++ b/_posts/2016-04-27-charma-gamifying-volunteer-process.md @@ -3,11 +3,10 @@ title: 'Charma - Gamifying the Volunteer Process' date: '2016-04-27 11:58' comments: true image: - default: - path: /assets/img/2016/04/banner.jpg - alt: Charma homepage - height: 470 - width: 800 + path: /assets/img/2016/04/banner.jpg + alt: Charma homepage + height: 470 + width: 800 published: true tag: "large project" description: "Charma is an open source API and web application that promotes volunteerism. It was produced by Grand Valley State University and sponsored by Microsoft." diff --git a/_posts/2016-04-29-testing-charma-with-selenium.md b/_posts/2016-04-29-testing-charma-with-selenium.md index 38397343c..71953df42 100644 --- a/_posts/2016-04-29-testing-charma-with-selenium.md +++ b/_posts/2016-04-29-testing-charma-with-selenium.md @@ -3,11 +3,10 @@ title: Testing Charma with Selenium date: '2016-04-29 21:26' comments: true image: - default: - path: /assets/img/2016/04/banner2.jpg - alt: Testing Charma with Visual Studio and Selenium - height: 438 - width: 800 + path: /assets/img/2016/04/banner2.jpg + alt: Testing Charma with Visual Studio and Selenium + height: 438 + width: 800 published: true tag: "medium project" description: "How I used Selenium WebDriver to test our ASP.net web application, Charma. We use the Google Chrome and Firefox webdriver to test our website." diff --git a/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md b/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md index 02ac0ab9e..5c36a576f 100644 --- a/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md +++ b/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md @@ -3,11 +3,10 @@ title: "N64 - The Legend of Zelda: Ocarina of Time Save Transfer Guide" date: "2016-05-01 14:10" comments: true image: - default: - path: /assets/img/2016/05/banner.jpg - alt: 'The Legend of Zelda: Ocarina of Time save converter' - height: 470 - width: 800 + path: /assets/img/2016/05/banner.jpg + alt: 'The Legend of Zelda: Ocarina of Time save converter' + height: 470 + width: 800 published: true tag: "guide" description: "An updated guide on how to dump the ram from The Legend of Zelda: Ocarina of Time on the Nintendo 64 and create an emulator friendly (.sra) save file." diff --git a/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md b/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md index 60fb7ae24..272d04022 100644 --- a/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md +++ b/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md @@ -3,11 +3,10 @@ title: "Streaming a Virtual Reality Spectator View to My Raspberry Pi 2" date: "2016-05-31 16:44" comments: true image: - default: - path: /assets/img/2016/05/banner2.jpg - alt: Raspberry Pi streaming setup behind monitor - height: 455 - width: 800 + path: /assets/img/2016/05/banner2.jpg + alt: Raspberry Pi streaming setup behind monitor + height: 455 + width: 800 published: true tag: "medium project" description: "How I used my Raspberry Pi 2 to stream my desktop using Moonlight Embedded for my HTC Vive virtual reality spectator view without interfering with SteamVR." diff --git a/_posts/2016-07-02-preventing-windows-application-notifications.md b/_posts/2016-07-02-preventing-windows-application-notifications.md index 99383ad48..8448e1b9f 100644 --- a/_posts/2016-07-02-preventing-windows-application-notifications.md +++ b/_posts/2016-07-02-preventing-windows-application-notifications.md @@ -3,11 +3,10 @@ title: "Preventing Windows Apps from Broadcasting a Taskbar Notification" date: "2016-07-02 12:33" comments: true image: - default: - path: /assets/img/2016/07/banner.png - alt: Windows registry notification entry - height: 480 - width: 1011 + path: /assets/img/2016/07/banner.png + alt: Windows registry notification entry + height: 480 + width: 1011 published: true tag: "small project" description: "Using the Windows 10 registry editor to remove or mute application notifications in the system taskbar that will not stay hidden after a reboot." diff --git a/_posts/2016-07-04-fixing-no-google-profile-for-contact.md b/_posts/2016-07-04-fixing-no-google-profile-for-contact.md index 559ac5992..b9659b989 100644 --- a/_posts/2016-07-04-fixing-no-google-profile-for-contact.md +++ b/_posts/2016-07-04-fixing-no-google-profile-for-contact.md @@ -3,11 +3,10 @@ title: "Fixing 'No Google Profile for Contact'" date: "2016-07-04 11:26" comments: true image: - default: - path: /assets/img/2016/07/banner2.jpg - alt: No Account for Google Profile on Android Wear Watch - height: 450 - width: 800 + path: /assets/img/2016/07/banner2.jpg + alt: No Account for Google Profile on Android Wear Watch + height: 450 + width: 800 published: true tag: "small project" description: "How I fixed the Google now 'No Google profile for Contact' message with my account. This occurred because of conflicting Google+ profiles." diff --git a/_posts/2017-01-04-backing-up-android-nougat-cats.md b/_posts/2017-01-04-backing-up-android-nougat-cats.md index f0548d231..0fc321eb7 100644 --- a/_posts/2017-01-04-backing-up-android-nougat-cats.md +++ b/_posts/2017-01-04-backing-up-android-nougat-cats.md @@ -3,11 +3,10 @@ title: "Backing Up Android Nougat Easter Egg Cats (No Root)" date: "2017-01-04 5:37" comments: true image: - default: - path: /assets/img/2017/01/banner.jpg - alt: Android Nougat Easter Egg App - height: 400 - width: 700 + path: /assets/img/2017/01/banner.jpg + alt: Android Nougat Easter Egg App + height: 400 + width: 700 published: true tag: "small project" description: "How to back up and restore your cats from the Google Android Nougat Neko Easter Egg without root using ADB." diff --git a/_posts/2017-02-22-improving-jekyll-2017.md b/_posts/2017-02-22-improving-jekyll-2017.md index c27ccf427..53f8ea41d 100644 --- a/_posts/2017-02-22-improving-jekyll-2017.md +++ b/_posts/2017-02-22-improving-jekyll-2017.md @@ -3,11 +3,10 @@ title: "Improving Jekyll in 2017" date: "2017-02-22 5:34" comments: true image: - default: - path: /assets/img/2017/02/banner.png - alt: Travis-CI build log for my Jekyll site - height: 400 - width: 700 + path: /assets/img/2017/02/banner.png + alt: Travis-CI build log for my Jekyll site + height: 400 + width: 700 published: true tag: "large project" description: "My Jekyll website needed an update; so I fixed that. This is how I added tests, Travis-CI builds, Accelerated Mobile Pages, SEO improvements, and more." From 36d41f4ce67fd191de3b2ec56f434187c707a83f Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Wed, 5 Apr 2017 14:57:46 -0400 Subject: [PATCH 2/9] fix stray char. Waste more bytes in commit message --- _includes/amp-check.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/amp-check.html b/_includes/amp-check.html index 4406a1d6d..9308a4971 100644 --- a/_includes/amp-check.html +++ b/_includes/amp-check.html @@ -5,7 +5,7 @@ {% assign open_tag = "" %} {% assign close_tag = "" %} - {% assign extract = seo_text | split: open_tag | last | split: close_tag | first % | prepend: open_tag | append: close_tag %} + {% assign extract = seo_text | split: open_tag | last | split: close_tag | first | prepend: open_tag | append: close_tag %} {% assign seo_text = seo_text | remove: extract %} {% assign open_tag = ' Date: Wed, 12 Apr 2017 13:51:12 -0400 Subject: [PATCH 3/9] Improvements for latest potential release with SEO Gem --- Gemfile | 8 +++++++- Gemfile.lock | 11 ++++++++--- _config.yml | 2 +- _includes/amp/post.html | 2 +- _layouts/post.html | 2 +- .../2013-09-22-restoring-vintage-with-3d-printing.md | 2 +- _posts/2015-04-11-transferring-n64-saves.md | 2 +- ...015-08-17-reverse-engineering-my-steelcase-desk.md | 2 +- ...2015-12-17-making-a-book-from-facebook-messages.md | 2 +- _posts/2016-03-14-word-auto-journal-macro-for-lazy.md | 2 +- _posts/2016-03-15-easy-inline-usb-power-switch.md | 2 +- _posts/2016-03-20-ios-video-bug-disclosure.markdown | 2 +- .../2016-04-27-charma-gamifying-volunteer-process.md | 2 +- _posts/2016-04-29-testing-charma-with-selenium.md | 2 +- ...6-05-01-ocarina-of-time-n64-save-transfer-guide.md | 2 +- _posts/2016-05-31-raspberry-pi-steam-vr-streaming.md | 2 +- ...02-preventing-windows-application-notifications.md | 2 +- ...2016-07-04-fixing-no-google-profile-for-contact.md | 2 +- _posts/2017-01-04-backing-up-android-nougat-cats.md | 2 +- _posts/2017-02-22-improving-jekyll-2017.md | 2 +- 20 files changed, 33 insertions(+), 22 deletions(-) diff --git a/Gemfile b/Gemfile index 233bd8aec..3e42a70e0 100644 --- a/Gemfile +++ b/Gemfile @@ -8,11 +8,17 @@ gem 'jekyll-gist' gem 'jekyll-last-modified-at' gem 'jekyll-paginate' gem 'jekyll-redirect-from' -gem 'jekyll-seo-tag' +# gem 'jekyll-seo-tag' gem 'jekyll-sitemap' gem 'nokogiri' gem 'rubocop' +group :jekyll_plugins do + git 'https://github.com/aav7fl/jekyll-seo-tag.git' do + gem 'jekyll-seo-tag', branch: 'master' + end +end + # Test the build group :test do gem 'html-proofer' diff --git a/Gemfile.lock b/Gemfile.lock index 2abfb4074..11b6cf019 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,10 @@ +GIT + remote: https://github.com/aav7fl/jekyll-seo-tag.git + revision: aa0b47bb8d9cf673e9e7ae7e272644b9421899df + specs: + jekyll-seo-tag (2.2.0) + jekyll (~> 3.3) + GEM remote: http://rubygems.org/ specs: @@ -56,8 +63,6 @@ GEM jekyll (~> 3.3) jekyll-sass-converter (1.5.0) sass (~> 3.4) - jekyll-seo-tag (2.1.0) - jekyll (~> 3.3) jekyll-sitemap (1.0.0) jekyll (~> 3.3) jekyll-watch (1.5.0) @@ -122,7 +127,7 @@ DEPENDENCIES jekyll-last-modified-at jekyll-paginate jekyll-redirect-from - jekyll-seo-tag + jekyll-seo-tag! jekyll-sitemap nokogiri rake diff --git a/_config.yml b/_config.yml index 32883e91c..9a74c4934 100644 --- a/_config.yml +++ b/_config.yml @@ -92,9 +92,9 @@ defaults: values: image: path: /assets/img/default-card.png - alt: Default-card height: 400 width: 700 + alt: Default-card - scope: path: _posts values: *post_val diff --git a/_includes/amp/post.html b/_includes/amp/post.html index 0a3b7e2aa..698de1a16 100644 --- a/_includes/amp/post.html +++ b/_includes/amp/post.html @@ -9,7 +9,7 @@

{{ page.date | date: '%B %d, %Y' }} | {{ page.content | number_ {% if page.image %}
- {{ page.image.alt }} + {{ page.alt }}
{% endif %} diff --git a/_layouts/post.html b/_layouts/post.html index c8f265bd8..fa97ce785 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -12,7 +12,7 @@

{{ page.content | number_of_words | divided_by:120 | ceil }} Mi {% if page.image %} - {{ page.image.alt }} + {{ page.alt }} {% endif %}
diff --git a/_posts/2013-09-22-restoring-vintage-with-3d-printing.md b/_posts/2013-09-22-restoring-vintage-with-3d-printing.md index 941cd2450..3b5156653 100644 --- a/_posts/2013-09-22-restoring-vintage-with-3d-printing.md +++ b/_posts/2013-09-22-restoring-vintage-with-3d-printing.md @@ -4,9 +4,9 @@ date: 2013-09-22 comments: true image: path: /assets/img/2013/09/small/DSC09139.JPG - alt: Marantz 2220B taken apart for upgrading parts height: 532 width: 800 +alt: Marantz 2220B taken apart for upgrading parts tag: "large project" description: "Restoring my 1974 Marantz 2220B lamp housing with 3D printing. The old lamp house was brittle and broke from the incandescent bulb heat. I now use LEDs." redirect_from: "/blog/restoring-vintage-with-3d-printing/" diff --git a/_posts/2015-04-11-transferring-n64-saves.md b/_posts/2015-04-11-transferring-n64-saves.md index 3827f5571..d5ee0e9ef 100644 --- a/_posts/2015-04-11-transferring-n64-saves.md +++ b/_posts/2015-04-11-transferring-n64-saves.md @@ -4,9 +4,9 @@ date: "2015-04-11 16:41" comments: true image: path: /assets/img/2015/04/DSC09669.JPG - alt: 'N64 interfacing with The Legend of Zelda: Ocarina of Time to dump active memory' height: 665 width: 1000 +alt: 'N64 interfacing with The Legend of Zelda: Ocarina of Time to dump active memory' published: true tag: "large project" description: "How I extracted my N64 save files such as Mario party and Zelda Ocarina of Time by dumping the ram, calculating the checksum and building the sra save file" diff --git a/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md b/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md index 29433d3dd..dcfb687dd 100644 --- a/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md +++ b/_posts/2015-08-17-reverse-engineering-my-steelcase-desk.md @@ -4,9 +4,9 @@ date: "2015-08-17 15:47" comments: true image: path: /assets/img/2015/08/banner.jpg - alt: Steelcase height-adjustable standing desk height: 779 width: 800 +alt: Steelcase height-adjustable standing desk published: true tag: "medium project" description: "How I reverse engineered the remote codes on my prototype Steelcase sit/stand desk unlocking secret developer codes to enable One Touch adjustments" diff --git a/_posts/2015-12-17-making-a-book-from-facebook-messages.md b/_posts/2015-12-17-making-a-book-from-facebook-messages.md index caeea690e..a1e54c753 100644 --- a/_posts/2015-12-17-making-a-book-from-facebook-messages.md +++ b/_posts/2015-12-17-making-a-book-from-facebook-messages.md @@ -4,9 +4,9 @@ date: "2015-12-17 18:00" comments: true image: path: /assets/img/2015/12/banner.jpg - alt: Custom hardcover book composed of facebook chat messages height: 814 width: 1000 +alt: Custom hardcover book composed of facebook chat messages published: true tag: "large project" description: "How I made a hardcover book for someone by downloading my Facebook message archive reversing the order of each 20,000 message segment for readability" diff --git a/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md b/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md index 7a182644e..91784450d 100644 --- a/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md +++ b/_posts/2016-03-14-word-auto-journal-macro-for-lazy.md @@ -4,9 +4,9 @@ date: "2016-03-14 16:19" comments: true image: path: /assets/img/2016/03/banner.png - alt: Microsoft Word output for auto journal macro height: 505 width: 964 +alt: Microsoft Word output for auto journal macro published: true tag: "small project" description: "I created a Microsoft Word macro that automatically generated a skeleton entry for today and added up the total hours documented thus far" diff --git a/_posts/2016-03-15-easy-inline-usb-power-switch.md b/_posts/2016-03-15-easy-inline-usb-power-switch.md index 906020497..9fe7477aa 100644 --- a/_posts/2016-03-15-easy-inline-usb-power-switch.md +++ b/_posts/2016-03-15-easy-inline-usb-power-switch.md @@ -4,9 +4,9 @@ date: "2016-03-15 20:25" comments: true image: path: /assets/img/2016/03/banner2.jpg - alt: Inline power switch on a USB cable height: 603 width: 800 +alt: Inline power switch on a USB cable published: true tag: "small project" description: "How I added a rocker in-line power switch into my 10 foot USB 2.0 Type b cable. I referenced the USB 2.0 specifications to understand which wires to cut." diff --git a/_posts/2016-03-20-ios-video-bug-disclosure.markdown b/_posts/2016-03-20-ios-video-bug-disclosure.markdown index 43ce6e0d4..42b3a3fc9 100644 --- a/_posts/2016-03-20-ios-video-bug-disclosure.markdown +++ b/_posts/2016-03-20-ios-video-bug-disclosure.markdown @@ -4,9 +4,9 @@ date: '2016-03-20 18:05' comments: true image: path: /assets/img/2016/03/iPadTesting.jpg - alt: Testing iPad Air 2 colors with i1Display Pro colorimeter height: 521 width: 800 +alt: Testing iPad Air 2 colors with i1Display Pro colorimeter published: true tag: "large project" description: "A public disclosure that I discovered of an iOS video playback bug that decreases red and becomes washed out when user interface elements are hidden" diff --git a/_posts/2016-04-27-charma-gamifying-volunteer-process.md b/_posts/2016-04-27-charma-gamifying-volunteer-process.md index 12b30b2a0..1f3edda03 100644 --- a/_posts/2016-04-27-charma-gamifying-volunteer-process.md +++ b/_posts/2016-04-27-charma-gamifying-volunteer-process.md @@ -4,9 +4,9 @@ date: '2016-04-27 11:58' comments: true image: path: /assets/img/2016/04/banner.jpg - alt: Charma homepage height: 470 width: 800 +alt: Charma homepage published: true tag: "large project" description: "Charma is an open source API and web application that promotes volunteerism. It was produced by Grand Valley State University and sponsored by Microsoft." diff --git a/_posts/2016-04-29-testing-charma-with-selenium.md b/_posts/2016-04-29-testing-charma-with-selenium.md index 71953df42..d9f035eff 100644 --- a/_posts/2016-04-29-testing-charma-with-selenium.md +++ b/_posts/2016-04-29-testing-charma-with-selenium.md @@ -4,9 +4,9 @@ date: '2016-04-29 21:26' comments: true image: path: /assets/img/2016/04/banner2.jpg - alt: Testing Charma with Visual Studio and Selenium height: 438 width: 800 +alt: Testing Charma with Visual Studio and Selenium published: true tag: "medium project" description: "How I used Selenium WebDriver to test our ASP.net web application, Charma. We use the Google Chrome and Firefox webdriver to test our website." diff --git a/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md b/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md index 5c36a576f..e37a61943 100644 --- a/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md +++ b/_posts/2016-05-01-ocarina-of-time-n64-save-transfer-guide.md @@ -4,9 +4,9 @@ date: "2016-05-01 14:10" comments: true image: path: /assets/img/2016/05/banner.jpg - alt: 'The Legend of Zelda: Ocarina of Time save converter' height: 470 width: 800 +alt: 'The Legend of Zelda: Ocarina of Time save converter' published: true tag: "guide" description: "An updated guide on how to dump the ram from The Legend of Zelda: Ocarina of Time on the Nintendo 64 and create an emulator friendly (.sra) save file." diff --git a/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md b/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md index 272d04022..640fd695e 100644 --- a/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md +++ b/_posts/2016-05-31-raspberry-pi-steam-vr-streaming.md @@ -4,9 +4,9 @@ date: "2016-05-31 16:44" comments: true image: path: /assets/img/2016/05/banner2.jpg - alt: Raspberry Pi streaming setup behind monitor height: 455 width: 800 +alt: Raspberry Pi streaming setup behind monitor published: true tag: "medium project" description: "How I used my Raspberry Pi 2 to stream my desktop using Moonlight Embedded for my HTC Vive virtual reality spectator view without interfering with SteamVR." diff --git a/_posts/2016-07-02-preventing-windows-application-notifications.md b/_posts/2016-07-02-preventing-windows-application-notifications.md index 8448e1b9f..fe723038a 100644 --- a/_posts/2016-07-02-preventing-windows-application-notifications.md +++ b/_posts/2016-07-02-preventing-windows-application-notifications.md @@ -4,9 +4,9 @@ date: "2016-07-02 12:33" comments: true image: path: /assets/img/2016/07/banner.png - alt: Windows registry notification entry height: 480 width: 1011 +alt: Windows registry notification entry published: true tag: "small project" description: "Using the Windows 10 registry editor to remove or mute application notifications in the system taskbar that will not stay hidden after a reboot." diff --git a/_posts/2016-07-04-fixing-no-google-profile-for-contact.md b/_posts/2016-07-04-fixing-no-google-profile-for-contact.md index b9659b989..3f5eee0be 100644 --- a/_posts/2016-07-04-fixing-no-google-profile-for-contact.md +++ b/_posts/2016-07-04-fixing-no-google-profile-for-contact.md @@ -4,9 +4,9 @@ date: "2016-07-04 11:26" comments: true image: path: /assets/img/2016/07/banner2.jpg - alt: No Account for Google Profile on Android Wear Watch height: 450 width: 800 +alt: No Account for Google Profile on Android Wear Watch published: true tag: "small project" description: "How I fixed the Google now 'No Google profile for Contact' message with my account. This occurred because of conflicting Google+ profiles." diff --git a/_posts/2017-01-04-backing-up-android-nougat-cats.md b/_posts/2017-01-04-backing-up-android-nougat-cats.md index 0fc321eb7..f9b53387f 100644 --- a/_posts/2017-01-04-backing-up-android-nougat-cats.md +++ b/_posts/2017-01-04-backing-up-android-nougat-cats.md @@ -4,9 +4,9 @@ date: "2017-01-04 5:37" comments: true image: path: /assets/img/2017/01/banner.jpg - alt: Android Nougat Easter Egg App height: 400 width: 700 +alt: Android Nougat Easter Egg App published: true tag: "small project" description: "How to back up and restore your cats from the Google Android Nougat Neko Easter Egg without root using ADB." diff --git a/_posts/2017-02-22-improving-jekyll-2017.md b/_posts/2017-02-22-improving-jekyll-2017.md index 53f8ea41d..c3cfa59db 100644 --- a/_posts/2017-02-22-improving-jekyll-2017.md +++ b/_posts/2017-02-22-improving-jekyll-2017.md @@ -4,9 +4,9 @@ date: "2017-02-22 5:34" comments: true image: path: /assets/img/2017/02/banner.png - alt: Travis-CI build log for my Jekyll site height: 400 width: 700 +alt: Travis-CI build log for my Jekyll site published: true tag: "large project" description: "My Jekyll website needed an update; so I fixed that. This is how I added tests, Travis-CI builds, Accelerated Mobile Pages, SEO improvements, and more." From ccfc9f206e78af4603ded7dfc2b8e407198e7c8b Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Wed, 12 Apr 2017 17:09:20 -0400 Subject: [PATCH 4/9] Update gem file to point at repo --- Gemfile | 6 +++--- Gemfile.lock | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 3e42a70e0..cf3b59e5f 100644 --- a/Gemfile +++ b/Gemfile @@ -14,9 +14,9 @@ gem 'nokogiri' gem 'rubocop' group :jekyll_plugins do - git 'https://github.com/aav7fl/jekyll-seo-tag.git' do - gem 'jekyll-seo-tag', branch: 'master' - end + gem 'jekyll-seo-tag', + git: 'https://github.com/aav7fl/jekyll-seo-tag.git', + branch: 'failing_tests' end # Test the build diff --git a/Gemfile.lock b/Gemfile.lock index 11b6cf019..cfd35ebe6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,7 @@ GIT remote: https://github.com/aav7fl/jekyll-seo-tag.git - revision: aa0b47bb8d9cf673e9e7ae7e272644b9421899df + revision: be9bdf7a9529eea83fb0d21def15b40a31765c61 + branch: failing_tests specs: jekyll-seo-tag (2.2.0) jekyll (~> 3.3) From d79813389291215eb6b50fa7223b40f7c781469c Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Wed, 19 Apr 2017 14:05:38 -0400 Subject: [PATCH 5/9] Add rough outline for rakefile/rspec --- .rspec | 2 + Gemfile | 13 ++--- Gemfile.lock | 35 ++++++++----- Rakefile | 11 ++++ bin/bundler | 17 +++++++ bin/htmldiff | 17 +++++++ bin/htmlproofer | 17 +++++++ bin/jekyll | 17 +++++++ bin/kramdown | 17 +++++++ bin/ldiff | 17 +++++++ bin/listen | 17 +++++++ bin/nokogiri | 17 +++++++ bin/posix-spawn-benchmark | 17 +++++++ bin/rake | 17 +++++++ bin/rougify | 17 +++++++ bin/rspec | 17 +++++++ bin/rubocop | 17 +++++++ bin/ruby-parse | 17 +++++++ bin/ruby-rewrite | 17 +++++++ bin/safe_yaml | 17 +++++++ bin/sass | 17 +++++++ bin/sass-convert | 17 +++++++ bin/scss | 17 +++++++ spec/JSON_spec.rb | 5 ++ spec/spec_helper.rb | 103 ++++++++++++++++++++++++++++++++++++++ 25 files changed, 473 insertions(+), 19 deletions(-) create mode 100644 .rspec create mode 100755 bin/bundler create mode 100755 bin/htmldiff create mode 100755 bin/htmlproofer create mode 100755 bin/jekyll create mode 100755 bin/kramdown create mode 100755 bin/ldiff create mode 100755 bin/listen create mode 100755 bin/nokogiri create mode 100755 bin/posix-spawn-benchmark create mode 100755 bin/rake create mode 100755 bin/rougify create mode 100755 bin/rspec create mode 100755 bin/rubocop create mode 100755 bin/ruby-parse create mode 100755 bin/ruby-rewrite create mode 100755 bin/safe_yaml create mode 100755 bin/sass create mode 100755 bin/sass-convert create mode 100755 bin/scss create mode 100644 spec/JSON_spec.rb create mode 100644 spec/spec_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 000000000..83e16f804 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/Gemfile b/Gemfile index cf3b59e5f..9c5fe3eca 100644 --- a/Gemfile +++ b/Gemfile @@ -8,16 +8,17 @@ gem 'jekyll-gist' gem 'jekyll-last-modified-at' gem 'jekyll-paginate' gem 'jekyll-redirect-from' -# gem 'jekyll-seo-tag' +gem 'jekyll-seo-tag' gem 'jekyll-sitemap' gem 'nokogiri' +gem 'rspec' gem 'rubocop' -group :jekyll_plugins do - gem 'jekyll-seo-tag', - git: 'https://github.com/aav7fl/jekyll-seo-tag.git', - branch: 'failing_tests' -end +# group :jekyll_plugins do +# gem 'jekyll-seo-tag', +# git: 'https://github.com/jekyll/jekyll-seo-tag.git', +# branch: 'master' +# end # Test the build group :test do diff --git a/Gemfile.lock b/Gemfile.lock index cfd35ebe6..fa70ddd1a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,3 @@ -GIT - remote: https://github.com/aav7fl/jekyll-seo-tag.git - revision: be9bdf7a9529eea83fb0d21def15b40a31765c61 - branch: failing_tests - specs: - jekyll-seo-tag (2.2.0) - jekyll (~> 3.3) - GEM remote: http://rubygems.org/ specs: @@ -24,6 +16,7 @@ GEM colorator (1.1.0) colored (1.2) concurrent-ruby (1.0.5) + diff-lcs (1.3) ethon (0.10.1) ffi (>= 1.3.0) faraday (0.12.0.1) @@ -64,7 +57,9 @@ GEM jekyll (~> 3.3) jekyll-sass-converter (1.5.0) sass (~> 3.4) - jekyll-sitemap (1.0.0) + jekyll-seo-tag (2.2.0) + jekyll (~> 3.3) + jekyll-sitemap (1.1.1) jekyll (~> 3.3) jekyll-watch (1.5.0) listen (~> 3.0, < 3.1) @@ -79,7 +74,7 @@ GEM multipart-post (2.0.0) nokogiri (1.7.1) mini_portile2 (~> 2.1.0) - octokit (4.6.2) + octokit (4.7.0) sawyer (~> 0.8.0, >= 0.5.3) parallel (1.11.1) parser (2.4.0.0) @@ -95,6 +90,19 @@ GEM rb-inotify (0.9.8) ffi (>= 0.5.0) rouge (1.11.1) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) rubocop (0.48.1) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) @@ -112,7 +120,7 @@ GEM ethon (>= 0.8.0) tzinfo (1.2.3) thread_safe (~> 0.1) - unicode-display_width (1.1.3) + unicode-display_width (1.2.1) yell (2.0.7) PLATFORMS @@ -128,11 +136,12 @@ DEPENDENCIES jekyll-last-modified-at jekyll-paginate jekyll-redirect-from - jekyll-seo-tag! + jekyll-seo-tag jekyll-sitemap nokogiri rake + rspec rubocop BUNDLED WITH - 1.14.4 + 1.14.6 diff --git a/Rakefile b/Rakefile index f8d1e1c17..6b35a8589 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,10 @@ require 'English' require 'html-proofer' +require 'rspec/core/rake_task' require 'rubocop/rake_task' require 'jekyll' +require 'uri' +require 'net/http' task default: [:test] @@ -74,6 +77,14 @@ task :amp do end end +desc 'Test JSON-LD' +task :json do + RSpec::Core::RakeTask.new(:spec) do |t| + t.pattern = 'spec/*_spec.rb' + end + Rake::Task["spec"].execute +end + desc 'Run RuboCop' task :rubocop do puts 'Running RuboCop Validator...'.yellow.bold diff --git a/bin/bundler b/bin/bundler new file mode 100755 index 000000000..d6107f047 --- /dev/null +++ b/bin/bundler @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'bundler' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("bundler", "bundler") diff --git a/bin/htmldiff b/bin/htmldiff new file mode 100755 index 000000000..09c825951 --- /dev/null +++ b/bin/htmldiff @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'htmldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "htmldiff") diff --git a/bin/htmlproofer b/bin/htmlproofer new file mode 100755 index 000000000..06cd95989 --- /dev/null +++ b/bin/htmlproofer @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'htmlproofer' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("html-proofer", "htmlproofer") diff --git a/bin/jekyll b/bin/jekyll new file mode 100755 index 000000000..068c3472d --- /dev/null +++ b/bin/jekyll @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'jekyll' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("jekyll", "jekyll") diff --git a/bin/kramdown b/bin/kramdown new file mode 100755 index 000000000..d4b31f66e --- /dev/null +++ b/bin/kramdown @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'kramdown' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("kramdown", "kramdown") diff --git a/bin/ldiff b/bin/ldiff new file mode 100755 index 000000000..a5e9564aa --- /dev/null +++ b/bin/ldiff @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "ldiff") diff --git a/bin/listen b/bin/listen new file mode 100755 index 000000000..65fe244ef --- /dev/null +++ b/bin/listen @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'listen' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("listen", "listen") diff --git a/bin/nokogiri b/bin/nokogiri new file mode 100755 index 000000000..c1f0ca44f --- /dev/null +++ b/bin/nokogiri @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'nokogiri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("nokogiri", "nokogiri") diff --git a/bin/posix-spawn-benchmark b/bin/posix-spawn-benchmark new file mode 100755 index 000000000..5ef90ebe4 --- /dev/null +++ b/bin/posix-spawn-benchmark @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'posix-spawn-benchmark' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("posix-spawn", "posix-spawn-benchmark") diff --git a/bin/rake b/bin/rake new file mode 100755 index 000000000..486010f46 --- /dev/null +++ b/bin/rake @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rake", "rake") diff --git a/bin/rougify b/bin/rougify new file mode 100755 index 000000000..a46ae6239 --- /dev/null +++ b/bin/rougify @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'rougify' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rouge", "rougify") diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 000000000..d738b23c0 --- /dev/null +++ b/bin/rspec @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rspec-core", "rspec") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 000000000..ccb4d5630 --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'rubocop' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/ruby-parse b/bin/ruby-parse new file mode 100755 index 000000000..20557e7b3 --- /dev/null +++ b/bin/ruby-parse @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ruby-parse' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-parse") diff --git a/bin/ruby-rewrite b/bin/ruby-rewrite new file mode 100755 index 000000000..60032ed17 --- /dev/null +++ b/bin/ruby-rewrite @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'ruby-rewrite' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-rewrite") diff --git a/bin/safe_yaml b/bin/safe_yaml new file mode 100755 index 000000000..5979200f1 --- /dev/null +++ b/bin/safe_yaml @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'safe_yaml' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("safe_yaml", "safe_yaml") diff --git a/bin/sass b/bin/sass new file mode 100755 index 000000000..ef9f699d8 --- /dev/null +++ b/bin/sass @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sass", "sass") diff --git a/bin/sass-convert b/bin/sass-convert new file mode 100755 index 000000000..13936f1df --- /dev/null +++ b/bin/sass-convert @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'sass-convert' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sass", "sass-convert") diff --git a/bin/scss b/bin/scss new file mode 100755 index 000000000..76c0dce5f --- /dev/null +++ b/bin/scss @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'scss' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sass", "scss") diff --git a/spec/JSON_spec.rb b/spec/JSON_spec.rb new file mode 100644 index 000000000..2bc72f06e --- /dev/null +++ b/spec/JSON_spec.rb @@ -0,0 +1,5 @@ +RSpec.describe "something" do + it "does something" do + fail + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 000000000..47b39ce49 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,103 @@ +# This file was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end From 8c62f2485e528ee7c6caf8272712312d599bcaaf Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Wed, 19 Apr 2017 14:37:26 -0400 Subject: [PATCH 6/9] Add proof of concept test for JSON-LD validation against google structured data tool --- Gemfile | 1 + Rakefile | 2 - spec/JSON_spec.rb | 62 ++++++++++++++++++++++-- spec/spec_helper.rb | 113 +++++++------------------------------------- 4 files changed, 75 insertions(+), 103 deletions(-) diff --git a/Gemfile b/Gemfile index 9c5fe3eca..f2aa59453 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ source 'http://rubygems.org' + gem 'amp-jekyll' gem 'fastimage' gem 'jekyll' diff --git a/Rakefile b/Rakefile index 6b35a8589..9f5dd3823 100644 --- a/Rakefile +++ b/Rakefile @@ -3,8 +3,6 @@ require 'html-proofer' require 'rspec/core/rake_task' require 'rubocop/rake_task' require 'jekyll' -require 'uri' -require 'net/http' task default: [:test] diff --git a/spec/JSON_spec.rb b/spec/JSON_spec.rb index 2bc72f06e..602a19b8b 100644 --- a/spec/JSON_spec.rb +++ b/spec/JSON_spec.rb @@ -1,5 +1,59 @@ -RSpec.describe "something" do - it "does something" do - fail - end +require "json" +require "open-uri" + +RSpec.describe "Test JSON" do + context "validating" do + let(:html) do + %() + end + + let(:html_invalid) do + %() + end + + it "validates" do + expect(html).to be_valid_json_ld + end + + it "does not validate" do + expect(html_invalid).not_to be_valid_json_ld + end + end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 47b39ce49..49f1147bb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,103 +1,22 @@ -# This file was generated by the `rspec --init` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end +require "uri" +require "net/http" - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true +RSpec::Matchers.define :be_valid_json_ld do |_expected| + match do |actual| + validate_json_ld(actual)["errors"].empty? end - # This option will default to `:apply_to_host_groups` in RSpec 4 (and will - # have no way to turn it off -- the option exists only for backwards - # compatibility in RSpec 3). It causes shared context metadata to be - # inherited by the metadata hash of host groups and examples, rather than - # triggering implicit auto-inclusion in groups with matching metadata. - config.shared_context_metadata_behavior = :apply_to_host_groups - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # This allows you to limit a spec run to individual examples or groups - # you care about by tagging them with `:focus` metadata. When nothing - # is tagged with `:focus`, all examples get run. RSpec also provides - # aliases for `it`, `describe`, and `context` that include `:focus` - # metadata: `fit`, `fdescribe` and `fcontext`, respectively. - config.filter_run_when_matching :focus - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # This setting enables warnings. It's recommended, but in some cases may - # be too noisy due to issues in dependencies. - config.warnings = true - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' + failure_message do |actual| + validate_json_ld(actual)["errors"] end - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end + def validate_json_ld(html) + params = { "html" => html } + url = URI.parse("https://search.google.com/structured-data/testing-tool/validate") + response = Net::HTTP.post_form(url, params) + JSON.parse(response.body.split("\n")[1]) + rescue + puts "Unable to validate JSON" + { "errors" => [] } + end end From 194cf7da70ce7eb9f244c4113a719952d2d7099c Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Wed, 19 Apr 2017 15:43:35 -0400 Subject: [PATCH 7/9] Parse JSON from a single file and test against --- spec/JSON_spec.rb | 86 +++++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/spec/JSON_spec.rb b/spec/JSON_spec.rb index 602a19b8b..19c328b60 100644 --- a/spec/JSON_spec.rb +++ b/spec/JSON_spec.rb @@ -5,47 +5,47 @@ context "validating" do let(:html) do %() + {"@context": "http://schema.org", + "@type": "BlogPosting", + "headline": "Improving Jekyll in 2017", + "author": {"@type": "Person", + "name": "Kyle Niewiada"}, + "image": {"@type": "ImageObject", + "url": "https://www.kyleniewiada.org/assets/img/2017/02/banner.png", + "height": 400, + "width": 700}, + "datePublished": "2017-02-22T05:34:00-05:00", + "dateModified": "2017-02-27T13:18:25-05:00", + "description": "My Jekyll website needed an update; so I fixed that. This is how I added tests, Travis-CI builds, Accelerated Mobile Pages, SEO improvements, and more.", + "publisher": {"@type": "Organization", + "name": "Kyle Niewiada", + "logo": {"@type": "ImageObject", + "url": "https://www.kyleniewiada.org/assets/img/logo.png"}}, + "mainEntityOfPage": {"@type": "WebPage", + "@id": "https://www.kyleniewiada.org/blog/2017/02/improving-jekyll-2017/"}, + "url": "https://www.kyleniewiada.org/blog/2017/02/improving-jekyll-2017/"}) end let(:html_invalid) do %() + {"@context": "http://schema.org", + "@type": "BlogPosting", + "headline": "Improving Jekyll in 2017", + "author": {"@type": "Person", + "name": "Kyle Niewiada"}, + "image": {"@type": "ImageObject", + "url": "https://www.kyleniewiada.org/assets/img/2017/02/banner.png", + "height": 400, + "width": 700}, + "dateModified": "2017-02-27T13:18:25-05:00", + "description": "My Jekyll website needed an update; so I fixed that. This is how I added tests, Travis-CI builds, Accelerated Mobile Pages, SEO improvements, and more.", + "publisher": {"@type": "Organization", + "name": "Kyle Niewiada", + "logo": {"@type": "ImageObject", + "url": "https://www.kyleniewiada.org/assets/img/logo.png"}}, + "mainEntityOfPage": {"@type": "WebPage", + "@id": "https://www.kyleniewiada.org/blog/2017/02/improving-jekyll-2017/"}, + "url": "https://www.kyleniewiada.org/blog/2017/02/improving-jekyll-2017/"}) end it "validates" do @@ -56,4 +56,16 @@ expect(html_invalid).not_to be_valid_json_ld end end + context "validate JSON-LD file" do + str_start = %() + + let(:html) do + IO.read("/home/kyle/website/aav7fl.github.io/_site/blog/2017/02/improving-jekyll-2017/index.html")[/#{str_start}(.*?)#{str_end}/m, 1] + end + + it "validates" do + expect(html).to be_valid_json_ld + end + end end From aa3f755c3741846fe1f39b097f843177e787654b Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Wed, 19 Apr 2017 16:46:29 -0400 Subject: [PATCH 8/9] Update Rake test for all HTML file. Cleaned up a bit. --- .rubocop.yml | 18 ++++++ Gemfile | 13 ++-- Gemfile.lock | 12 +++- Rakefile | 7 ++- bin/bundler | 17 ------ bin/htmldiff | 17 ------ bin/htmlproofer | 17 ------ bin/jekyll | 17 ------ bin/kramdown | 17 ------ bin/ldiff | 17 ------ bin/listen | 17 ------ bin/nokogiri | 17 ------ bin/posix-spawn-benchmark | 17 ------ bin/rake | 17 ------ bin/rougify | 17 ------ bin/rspec | 17 ------ bin/rubocop | 17 ------ bin/ruby-parse | 17 ------ bin/ruby-rewrite | 17 ------ bin/safe_yaml | 17 ------ bin/sass | 17 ------ bin/sass-convert | 17 ------ bin/scss | 17 ------ spec/JSON_spec.rb | 122 ++++++++++++++++++++------------------ spec/spec_helper.rb | 16 ++--- 25 files changed, 109 insertions(+), 402 deletions(-) delete mode 100755 bin/bundler delete mode 100755 bin/htmldiff delete mode 100755 bin/htmlproofer delete mode 100755 bin/jekyll delete mode 100755 bin/kramdown delete mode 100755 bin/ldiff delete mode 100755 bin/listen delete mode 100755 bin/nokogiri delete mode 100755 bin/posix-spawn-benchmark delete mode 100755 bin/rake delete mode 100755 bin/rougify delete mode 100755 bin/rspec delete mode 100755 bin/rubocop delete mode 100755 bin/ruby-parse delete mode 100755 bin/ruby-rewrite delete mode 100755 bin/safe_yaml delete mode 100755 bin/sass delete mode 100755 bin/sass-convert delete mode 100755 bin/scss diff --git a/.rubocop.yml b/.rubocop.yml index b04f43d35..28d65d27c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,21 @@ +Metrics/LineLength: + Exclude: + - spec/**/* + +Metrics/BlockLength: + Exclude: + - spec/**/* + +Style/Documentation: + Enabled: false + +Style/FileName: + Enabled: false + +Style/IndentHeredoc: + Exclude: + - spec/**/* + AllCops: Exclude: - vendor/**/* # Ignore Travis-CI build directory diff --git a/Gemfile b/Gemfile index f2aa59453..82e0b8e8e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source 'http://rubygems.org' - gem 'amp-jekyll' gem 'fastimage' gem 'jekyll' @@ -9,17 +8,17 @@ gem 'jekyll-gist' gem 'jekyll-last-modified-at' gem 'jekyll-paginate' gem 'jekyll-redirect-from' -gem 'jekyll-seo-tag' +# gem 'jekyll-seo-tag' gem 'jekyll-sitemap' gem 'nokogiri' gem 'rspec' gem 'rubocop' -# group :jekyll_plugins do -# gem 'jekyll-seo-tag', -# git: 'https://github.com/jekyll/jekyll-seo-tag.git', -# branch: 'master' -# end +group :jekyll_plugins do + gem 'jekyll-seo-tag', + git: 'https://github.com/jekyll/jekyll-seo-tag.git', + branch: 'author-by-reference' +end # Test the build group :test do diff --git a/Gemfile.lock b/Gemfile.lock index fa70ddd1a..e5496015a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,11 @@ +GIT + remote: https://github.com/jekyll/jekyll-seo-tag.git + revision: e0c8173de28c8b7aeb21c7cc9c44f536cc7543a1 + branch: author-by-reference + specs: + jekyll-seo-tag (2.2.0) + jekyll (~> 3.3) + GEM remote: http://rubygems.org/ specs: @@ -57,8 +65,6 @@ GEM jekyll (~> 3.3) jekyll-sass-converter (1.5.0) sass (~> 3.4) - jekyll-seo-tag (2.2.0) - jekyll (~> 3.3) jekyll-sitemap (1.1.1) jekyll (~> 3.3) jekyll-watch (1.5.0) @@ -136,7 +142,7 @@ DEPENDENCIES jekyll-last-modified-at jekyll-paginate jekyll-redirect-from - jekyll-seo-tag + jekyll-seo-tag! jekyll-sitemap nokogiri rake diff --git a/Rakefile b/Rakefile index 9f5dd3823..61ebc4209 100644 --- a/Rakefile +++ b/Rakefile @@ -77,10 +77,12 @@ end desc 'Test JSON-LD' task :json do + puts 'Testing JSON-LD against Google Structured Data Testing + Tool...'.yellow.bold RSpec::Core::RakeTask.new(:spec) do |t| t.pattern = 'spec/*_spec.rb' end - Rake::Task["spec"].execute + Rake::Task['spec'].execute end desc 'Run RuboCop' @@ -91,8 +93,9 @@ end desc 'Run all tests' task :test do - Rake::Task['rubocop'].invoke Rake::Task['build'].invoke + Rake::Task['json'].invoke + Rake::Task['rubocop'].invoke Rake::Task['html_proofer'].invoke Rake::Task['amp'].invoke end diff --git a/bin/bundler b/bin/bundler deleted file mode 100755 index d6107f047..000000000 --- a/bin/bundler +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'bundler' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("bundler", "bundler") diff --git a/bin/htmldiff b/bin/htmldiff deleted file mode 100755 index 09c825951..000000000 --- a/bin/htmldiff +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'htmldiff' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("diff-lcs", "htmldiff") diff --git a/bin/htmlproofer b/bin/htmlproofer deleted file mode 100755 index 06cd95989..000000000 --- a/bin/htmlproofer +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'htmlproofer' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("html-proofer", "htmlproofer") diff --git a/bin/jekyll b/bin/jekyll deleted file mode 100755 index 068c3472d..000000000 --- a/bin/jekyll +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'jekyll' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("jekyll", "jekyll") diff --git a/bin/kramdown b/bin/kramdown deleted file mode 100755 index d4b31f66e..000000000 --- a/bin/kramdown +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'kramdown' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("kramdown", "kramdown") diff --git a/bin/ldiff b/bin/ldiff deleted file mode 100755 index a5e9564aa..000000000 --- a/bin/ldiff +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'ldiff' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("diff-lcs", "ldiff") diff --git a/bin/listen b/bin/listen deleted file mode 100755 index 65fe244ef..000000000 --- a/bin/listen +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'listen' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("listen", "listen") diff --git a/bin/nokogiri b/bin/nokogiri deleted file mode 100755 index c1f0ca44f..000000000 --- a/bin/nokogiri +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'nokogiri' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("nokogiri", "nokogiri") diff --git a/bin/posix-spawn-benchmark b/bin/posix-spawn-benchmark deleted file mode 100755 index 5ef90ebe4..000000000 --- a/bin/posix-spawn-benchmark +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'posix-spawn-benchmark' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("posix-spawn", "posix-spawn-benchmark") diff --git a/bin/rake b/bin/rake deleted file mode 100755 index 486010f46..000000000 --- a/bin/rake +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rake' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rake", "rake") diff --git a/bin/rougify b/bin/rougify deleted file mode 100755 index a46ae6239..000000000 --- a/bin/rougify +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rougify' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rouge", "rougify") diff --git a/bin/rspec b/bin/rspec deleted file mode 100755 index d738b23c0..000000000 --- a/bin/rspec +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rspec' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rspec-core", "rspec") diff --git a/bin/rubocop b/bin/rubocop deleted file mode 100755 index ccb4d5630..000000000 --- a/bin/rubocop +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'rubocop' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/ruby-parse b/bin/ruby-parse deleted file mode 100755 index 20557e7b3..000000000 --- a/bin/ruby-parse +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'ruby-parse' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("parser", "ruby-parse") diff --git a/bin/ruby-rewrite b/bin/ruby-rewrite deleted file mode 100755 index 60032ed17..000000000 --- a/bin/ruby-rewrite +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'ruby-rewrite' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("parser", "ruby-rewrite") diff --git a/bin/safe_yaml b/bin/safe_yaml deleted file mode 100755 index 5979200f1..000000000 --- a/bin/safe_yaml +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'safe_yaml' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("safe_yaml", "safe_yaml") diff --git a/bin/sass b/bin/sass deleted file mode 100755 index ef9f699d8..000000000 --- a/bin/sass +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'sass' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("sass", "sass") diff --git a/bin/sass-convert b/bin/sass-convert deleted file mode 100755 index 13936f1df..000000000 --- a/bin/sass-convert +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'sass-convert' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("sass", "sass-convert") diff --git a/bin/scss b/bin/scss deleted file mode 100755 index 76c0dce5f..000000000 --- a/bin/scss +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -# -# This file was generated by Bundler. -# -# The application 'scss' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("sass", "scss") diff --git a/spec/JSON_spec.rb b/spec/JSON_spec.rb index 19c328b60..3c2d00f29 100644 --- a/spec/JSON_spec.rb +++ b/spec/JSON_spec.rb @@ -1,71 +1,75 @@ -require "json" -require "open-uri" +require 'json' +require 'open-uri' -RSpec.describe "Test JSON" do - context "validating" do - let(:html) do - %() - end +RSpec.describe 'Test JSON-LD' do + context 'validating examples' do + let(:html_valid) do + %() + end - let(:html_invalid) do - %() - end + let(:html_invalid) do + %() + end - it "validates" do - expect(html).to be_valid_json_ld - end + it 'validates' do + expect(html_valid).to be_valid_json_ld + end - it "does not validate" do - expect(html_invalid).not_to be_valid_json_ld - end + it 'does not validate' do + expect(html_invalid).not_to be_valid_json_ld end - context "validate JSON-LD file" do + end + + context 'validating pages' do str_start = %() - let(:html) do - IO.read("/home/kyle/website/aav7fl.github.io/_site/blog/2017/02/improving-jekyll-2017/index.html")[/#{str_start}(.*?)#{str_end}/m, 1] - end + Dir.glob('_site/**/*.html') do |my_html_file| + context my_html_file.to_s do + let(:html) do + IO.read(my_html_file.to_s)[/#{str_start}(.*?)#{str_end}/m, 1] + end - it "validates" do - expect(html).to be_valid_json_ld + it 'validates' do + expect(html).to be_valid_json_ld + end + end end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 49f1147bb..7e4f9a043 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,22 +1,22 @@ -require "uri" -require "net/http" +require 'uri' +require 'net/http' RSpec::Matchers.define :be_valid_json_ld do |_expected| match do |actual| - validate_json_ld(actual)["errors"].empty? + validate_json_ld(actual)['errors'].empty? end failure_message do |actual| - validate_json_ld(actual)["errors"] + validate_json_ld(actual)['errors'] end def validate_json_ld(html) - params = { "html" => html } - url = URI.parse("https://search.google.com/structured-data/testing-tool/validate") + params = { 'html' => html } + url = URI.parse('https://search.google.com/structured-data/testing-tool/validate') response = Net::HTTP.post_form(url, params) JSON.parse(response.body.split("\n")[1]) rescue - puts "Unable to validate JSON" - { "errors" => [] } + puts 'Unable to validate JSON' + { 'errors' => [] } end end From 35e8a3c1976636e374df14819e3a9e36f0caa3ea Mon Sep 17 00:00:00 2001 From: Kyle Niewiada Date: Tue, 25 Apr 2017 11:40:38 -0400 Subject: [PATCH 9/9] Update SEO Gem to point to production release --- Gemfile | 12 ++++++------ Gemfile.lock | 12 +++--------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index 82e0b8e8e..9c5fe3eca 100644 --- a/Gemfile +++ b/Gemfile @@ -8,17 +8,17 @@ gem 'jekyll-gist' gem 'jekyll-last-modified-at' gem 'jekyll-paginate' gem 'jekyll-redirect-from' -# gem 'jekyll-seo-tag' +gem 'jekyll-seo-tag' gem 'jekyll-sitemap' gem 'nokogiri' gem 'rspec' gem 'rubocop' -group :jekyll_plugins do - gem 'jekyll-seo-tag', - git: 'https://github.com/jekyll/jekyll-seo-tag.git', - branch: 'author-by-reference' -end +# group :jekyll_plugins do +# gem 'jekyll-seo-tag', +# git: 'https://github.com/jekyll/jekyll-seo-tag.git', +# branch: 'master' +# end # Test the build group :test do diff --git a/Gemfile.lock b/Gemfile.lock index e5496015a..aa3a6d89e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,3 @@ -GIT - remote: https://github.com/jekyll/jekyll-seo-tag.git - revision: e0c8173de28c8b7aeb21c7cc9c44f536cc7543a1 - branch: author-by-reference - specs: - jekyll-seo-tag (2.2.0) - jekyll (~> 3.3) - GEM remote: http://rubygems.org/ specs: @@ -65,6 +57,8 @@ GEM jekyll (~> 3.3) jekyll-sass-converter (1.5.0) sass (~> 3.4) + jekyll-seo-tag (2.2.1) + jekyll (~> 3.3) jekyll-sitemap (1.1.1) jekyll (~> 3.3) jekyll-watch (1.5.0) @@ -142,7 +136,7 @@ DEPENDENCIES jekyll-last-modified-at jekyll-paginate jekyll-redirect-from - jekyll-seo-tag! + jekyll-seo-tag jekyll-sitemap nokogiri rake