diff --git a/assets/images/docs.png b/assets/images/docs.png index 52b560aa..582e0915 100644 Binary files a/assets/images/docs.png and b/assets/images/docs.png differ diff --git a/assets/images/docs@2x.png b/assets/images/docs@2x.png index ad0a3d3a..bb6b7368 100644 Binary files a/assets/images/docs@2x.png and b/assets/images/docs@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index fca75ed8..d7c98e1c 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,5 +1,8 @@ [ [ + "2017-05-14", + "New documentation: Liquid" + ], [ "2017-04-30", "New documentation: OpenJDK" ], [ diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index b55f04c5..2c82650b 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -323,6 +323,11 @@ credits = [ '2009-2016 The Core Less Team', 'CC BY', 'https://creativecommons.org/licenses/by/3.0/' + ], [ + 'Liquid', + '2005, 2006 Tobias Luetke', + 'MIT', + 'https://raw.githubusercontent.com/Shopify/liquid/master/LICENSE' ], [ 'Lo-Dash', '2012-2016 The Dojo Foundation', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index d458307e..76d43c66 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -43,6 +43,7 @@ %icon-clipboard-white { background-position: -1rem -2rem; } %icon-close-white { background-position: -2rem -2rem; } +._icon-liquid:before { background-position: -1rem 0; } ._icon-openjdk:before { background-position: -2rem 0; } ._icon-codeceptjs:before { background-position: -3rem 0; } ._icon-codeception:before { background-position: -4rem 0; } diff --git a/assets/stylesheets/pages/_liquid.scss b/assets/stylesheets/pages/_liquid.scss index 55ad0abb..9072acc0 100644 --- a/assets/stylesheets/pages/_liquid.scss +++ b/assets/stylesheets/pages/_liquid.scss @@ -1,18 +1,5 @@ ._liquid { @extend %simple; - .code-label { - @extend %block-label, %label-green; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - margin-left: 0; - margin-right: 0; - margin-bottom: -1px; - } - - .code-label ~ div > pre { - margin-top: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; - } + p.code-label { @extend %pre-heading; } } diff --git a/lib/docs/filters/liquid/clean_html.rb b/lib/docs/filters/liquid/clean_html.rb index 1086d70d..1a28d112 100644 --- a/lib/docs/filters/liquid/clean_html.rb +++ b/lib/docs/filters/liquid/clean_html.rb @@ -2,29 +2,16 @@ module Docs class Liquid class CleanHtmlFilter < Filter def call - root_page? ? root : other - end - - def root - doc = at_css('.home-banner') - - css('.btn-row').remove - - doc - end - - def other - doc = at_css('.content__area > .content') + @doc = at_css('.content__area > .content') - css('button.menu-button').remove + css('.home-banner', '.menu-button', '#used-by', '#used-by ~ *').remove - css('code').each do |node| - node.remove_attribute('class') - node.content = node.content + css('.highlighter-rouge').each do |node| + node.before(node.children).remove end - css('pre', '.highlighter-rouge').each do |node| - node.remove_attribute('class') + css('pre').each do |node| + node.content = node.content.strip end doc diff --git a/lib/docs/filters/liquid/entries.rb b/lib/docs/filters/liquid/entries.rb index b984a463..f787d69f 100644 --- a/lib/docs/filters/liquid/entries.rb +++ b/lib/docs/filters/liquid/entries.rb @@ -6,23 +6,16 @@ module Docs end def get_type - if not root_page? - slug.split('/').first.capitalize - end + slug.split('/').first.capitalize end def additional_entries - entries = [] + return [] unless type == 'Tags' - if get_type == 'Tags' - css('h2').each do |node| - entries << [node.content, node['id']] - end + css('h2').map do |node| + [node.content, node['id']] end - - entries end - end end end diff --git a/lib/docs/scrapers/liquid.rb b/lib/docs/scrapers/liquid.rb index af06314d..d8f04050 100644 --- a/lib/docs/scrapers/liquid.rb +++ b/lib/docs/scrapers/liquid.rb @@ -2,18 +2,21 @@ module Docs class Liquid < UrlScraper self.name = 'Liquid' self.type = 'liquid' - self.base_url = "https://shopify.github.io/liquid/" + self.base_url = 'https://shopify.github.io/liquid/' + self.release = '4.0.0' self.links = { - home: 'http://liquidmarkup.org/', - code: 'https://github.com/shopify/liquid' + home: 'https://shopify.github.io/liquid/', + code: 'https://github.com/Shopify/liquid' } - html_filters.push 'liquid/entries', 'liquid/clean_html' + html_filters.push 'liquid/entries', 'liquid/clean_html', 'title' + + options[:title] = false + options[:root_title] = 'Liquid' options[:attribution] = <<-HTML © 2005, 2006 Tobias Luetke
Licensed under the MIT License. HTML - end end diff --git a/public/icons/docs/liquid/16.png b/public/icons/docs/liquid/16.png new file mode 100644 index 00000000..a3de84ad Binary files /dev/null and b/public/icons/docs/liquid/16.png differ diff --git a/public/icons/docs/liquid/16@2x.png b/public/icons/docs/liquid/16@2x.png new file mode 100644 index 00000000..d852600d Binary files /dev/null and b/public/icons/docs/liquid/16@2x.png differ diff --git a/public/icons/docs/liquid/SOURCE b/public/icons/docs/liquid/SOURCE deleted file mode 100644 index 8050d8ca..00000000 --- a/public/icons/docs/liquid/SOURCE +++ /dev/null @@ -1 +0,0 @@ -https://shopify.github.io/liquid/images/icons/water-drop-64x.png diff --git a/public/icons/docs/liquid/water-drop-64x.png b/public/icons/docs/liquid/water-drop-64x.png deleted file mode 100644 index 64b55c4d..00000000 Binary files a/public/icons/docs/liquid/water-drop-64x.png and /dev/null differ