From 069488dea398fa6124602e43ae633fe4781a4837 Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Mon, 3 Nov 2014 20:17:03 +0100 Subject: Use Jekyll data for Wall of Browser Bugs --- docs/_plugins/bugify.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/_plugins/bugify.rb (limited to 'docs/_plugins') diff --git a/docs/_plugins/bugify.rb b/docs/_plugins/bugify.rb new file mode 100644 index 000000000..e22f1da63 --- /dev/null +++ b/docs/_plugins/bugify.rb @@ -0,0 +1,25 @@ +module Jekyll + module BugFilter + def bugify(input) + upstream_map = { + "Bootstrap" => "https://github.com/twbs/bootstrap/issues/", + "IE" => ["https://connect.microsoft.com/IE/feedback/details/", "IE bug"], + "Mozilla" => ["https://bugzilla.mozilla.org/show_bug.cgi?id=", "Mozilla bug"], + "Chromium" => ["https://code.google.com/p/chromium/issues/detail?id=", "Chromium issue"], + "WebKit" => ["https://bugs.webkit.org/show_bug.cgi?id=", "WebKit bug"], + "Safari" => ["http://openradar.appspot.com/", "Apple Safari Radar"], + "Normalize" => ["https://github.com/necolas/normalize.css/issues/", "Normalize"] + } + + upstream_map.each do |key, data| + url = data.is_a?(Array) ? data[0] : data + label = data.is_a?(Array) ? "#{data[1]} " : "" + input = input.gsub(/#{key}#(\d+)/, "#{label}#\\1") + end + + return input + end + end +end + +Liquid::Template.register_filter(Jekyll::BugFilter) \ No newline at end of file -- cgit v1.2.3