From 8b523695cbaf65ea4e8da33027c77566b51399c1 Mon Sep 17 00:00:00 2001 From: David MacMahon Date: Sun, 10 Apr 2016 23:44:20 -0700 Subject: [PATCH] Fix #11924 Make RDoc::Servlet and the Darkfish generator be consistent with each other so that stylesheets and javascripts and fonts will be properly found when browsing RDoc documentation served up by `gem server`. This fixes issue #11924: $ gem server is broken for documentation browsing --- lib/rdoc/generator/template/darkfish/css/fonts.css | 12 ++++++------ lib/rdoc/servlet.rb | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/rdoc/generator/template/darkfish/css/fonts.css b/lib/rdoc/generator/template/darkfish/css/fonts.css index e9e7211..57302b5 100644 --- a/lib/rdoc/generator/template/darkfish/css/fonts.css +++ b/lib/rdoc/generator/template/darkfish/css/fonts.css @@ -17,7 +17,7 @@ font-weight: 400; src: local("Source Code Pro"), local("SourceCodePro-Regular"), - url("fonts/SourceCodePro-Regular.ttf") format("truetype"); + url("../fonts/SourceCodePro-Regular.ttf") format("truetype"); } @font-face { @@ -26,7 +26,7 @@ font-weight: 700; src: local("Source Code Pro Bold"), local("SourceCodePro-Bold"), - url("fonts/SourceCodePro-Bold.ttf") format("truetype"); + url("../fonts/SourceCodePro-Bold.ttf") format("truetype"); } /* @@ -46,7 +46,7 @@ font-weight: 300; src: local("Lato Light"), local("Lato-Light"), - url("fonts/Lato-Light.ttf") format("truetype"); + url("../fonts/Lato-Light.ttf") format("truetype"); } @font-face { @@ -55,7 +55,7 @@ font-weight: 300; src: local("Lato Light Italic"), local("Lato-LightItalic"), - url("fonts/Lato-LightItalic.ttf") format("truetype"); + url("../fonts/Lato-LightItalic.ttf") format("truetype"); } @font-face { @@ -64,7 +64,7 @@ font-weight: 700; src: local("Lato Regular"), local("Lato-Regular"), - url("fonts/Lato-Regular.ttf") format("truetype"); + url("../fonts/Lato-Regular.ttf") format("truetype"); } @font-face { @@ -73,7 +73,7 @@ font-weight: 700; src: local("Lato Italic"), local("Lato-Italic"), - url("fonts/Lato-RegularItalic.ttf") format("truetype"); + url("../fonts/Lato-RegularItalic.ttf") format("truetype"); } /* diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb index 0da87db..1acce8e 100644 --- a/lib/rdoc/servlet.rb +++ b/lib/rdoc/servlet.rb @@ -116,8 +116,9 @@ def do_GET req, res case req.path when '/' then root req, res - when '/rdoc.css', '/js/darkfish.js', '/js/jquery.js', '/js/search.js', - %r%^/images/% then + when '/css/fonts.css', '/css/rdoc.css', + '/js/darkfish.js', '/js/jquery.js', '/js/search.js', + %r%^/fonts/%, %r%^/images/% then asset :darkfish, req, res when '/js/navigation.js', '/js/searcher.js' then asset :json_index, req, res -- 2.6.4 (Apple Git-63)