@@ -22,6 +22,24 @@
}
+//
+// Official Website box
+
+._official {
+ clear: both;
+ margin: 2rem 0 1.5rem;
+ font-size: .75rem;
+ color: $textColorLight;
+ text-align: center;
+ -webkit-font-smoothing: subpixel-antialiased;
+ & + & { margin-top: 1.5rem; }
+ & + & > ._attribution-link { display: none; }
+}
+._official-link { @extend %external-link; }
//
// Attribution box
@@ -34,7 +34,7 @@ module Docs
self.text_filters = FilterStack.new
html_filters.push 'container', 'clean_html', 'normalize_urls', 'internal_urls', 'normalize_paths'
- text_filters.push 'inner_html', 'clean_text', 'attribution'
+ text_filters.push 'official_url', 'inner_html', 'clean_text', 'attribution'
def build_page(path)
response = request_one url_for(path)
@@ -0,0 +1,15 @@
+module Docs
+ class OfficialUrlFilter < Filter
+ def call
+ official_url_html << html if base_url
+ end
+ def official_url_html
+ <<-HTML.strip_heredoc
+ <div class="_official">
+ Official Documentation: <a href="#{base_url}" class="_official-link">#{base_url}</a>
+ </div>
+ HTML
+end