From 7fbcb26c014c206da74ca1d381ee0f5c23087e73 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Thu, 30 Jan 2020 15:42:19 -0300 Subject: [PATCH 1/3] Disable links to missing API docs. Signed-off-by: Michel Hidalgo --- _includes/package_links.html | 9 ++++----- _plugins/rosindex_generator.rb | 11 ++++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/_includes/package_links.html b/_includes/package_links.html index b0f6e80..aed5aec 100644 --- a/_includes/package_links.html +++ b/_includes/package_links.html @@ -13,11 +13,10 @@ {% endif %}
- + {%if hide_link_labels%}
{%endif%} API Docs diff --git a/_plugins/rosindex_generator.rb b/_plugins/rosindex_generator.rb index 2bf6ba3..371657a 100644 --- a/_plugins/rosindex_generator.rb +++ b/_plugins/rosindex_generator.rb @@ -14,7 +14,7 @@ require 'uri' require 'set' require 'yaml' -require "net/http" +require 'net/http' require 'thread' # local libs @@ -513,6 +513,15 @@ def extract_package(site, distro, repo, snapshot, checkout_path, path, pkg_type, docs_uri = "http://docs.ros.org/#{DEFAULT_LANGUAGE_PREFIX}/#{distro}/p/#{package_name}" end + # ensure documentation uri refers to an existing site + url = URI(docs_uri) + Net::HTTP.start(url.host, url.port) do |http| + response = http.head(url.path) + if response.code != '200' + docs_uri = '' + end + end + # try to acquire information on the CI status of the package ci_data = get_ci_data(distro, package_name, repo.name) From 9d0c592d02ef810480128293c6b917d943236682 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Fri, 7 Feb 2020 17:54:24 -0300 Subject: [PATCH 2/3] Use 'else' clause instead of separate 'unless'. Signed-off-by: Michel Hidalgo --- _includes/package_links.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_includes/package_links.html b/_includes/package_links.html index aed5aec..59492bc 100644 --- a/_includes/package_links.html +++ b/_includes/package_links.html @@ -14,8 +14,11 @@