From ab80b6f943b5d99e443a5c53150378a7fe61ec73 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Sat, 22 Dec 2018 10:19:46 -0600 Subject: [PATCH] Validate documentation for broken links and images --- appveyor.yml | 20 ++++++++++++++++++-- docs/404.html | 10 ---------- docs/404.md | 2 ++ docs/Gemfile | 4 ++++ docs/checksite.rb | 15 +++++++++++++++ 5 files changed, 39 insertions(+), 12 deletions(-) delete mode 100644 docs/404.html create mode 100644 docs/404.md create mode 100644 docs/checksite.rb diff --git a/appveyor.yml b/appveyor.yml index 3315fbc95..bcbb62fcf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,18 @@ version: '{branch}-{build}' +#init: +# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + +#on_finish: +# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + +install: + - set PATH=C:\Ruby25-x64\bin;%PATH% + - cd docs + - bundle install --quiet + - cd .. + - cp c:\Tools\curl\bin\libcurl.dll C:\Ruby25-x64\bin + before_build: - nuget restore Mirror/Networking.sln @@ -13,6 +26,10 @@ skip_tags: true build_script: - msbuild Mirror/Networking.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Configuration="Debug-Editor" /ConsoleLoggerParameters:Verbosity=quiet - msbuild Mirror/Networking.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Configuration="Debug" /ConsoleLoggerParameters:Verbosity=quiet + - cd docs + - bundle exec jekyll build + - ruby checksite.rb + - cd .. artifacts: - path: Mirror/Output @@ -31,10 +48,9 @@ after_test: skip_commits: files: - - '**/*.md' + - '/*.md' - '**/*.txt' - '.gitignore' - - 'docs/' deploy: description: 'This is a bleeding edge release. BACKUP BEFORE USING THIS AUTOMATED BUILD\n$(APPVEYOR_REPO_COMMIT_MESSAGE)' diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index f756ee68b..000000000 --- a/docs/404.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: default ---- - -
-

404

- -

Page not found :(

-

The requested page could not be found.

-
diff --git a/docs/404.md b/docs/404.md new file mode 100644 index 000000000..cc7fa210b --- /dev/null +++ b/docs/404.md @@ -0,0 +1,2 @@ +# Page not found :( +The requested page could not be found. diff --git a/docs/Gemfile b/docs/Gemfile index 25ff3efe1..847fa4c88 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -14,3 +14,7 @@ source "https://rubygems.org" # If you want to use GitHub Pages, remove the "gem "jekyll"" above and # uncomment the line below. To upgrade, run `bundle update github-pages`. gem "github-pages", group: :jekyll_plugins +gem "jekyll-feed" +gem "jekyll-sitemap" +gem "html-proofer" + diff --git a/docs/checksite.rb b/docs/checksite.rb new file mode 100644 index 000000000..b875b32f9 --- /dev/null +++ b/docs/checksite.rb @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby + +require 'html-proofer' + +options = { + :assume_extension => true, # (true) for extensionless paths + :http_status_ignore => [ 999 ], # LinkedIn throttling errors + :typhoeus => { + # avoid strange SSL errors: https://github.com/gjtorikian/html-proofer/issues/376 + :ssl_verifypeer => false, + :ssl_verifyhost => 0 + } +} + +HTMLProofer.check_directory("./_site", options).run \ No newline at end of file