Adjust the tailwind entries generator to support tailwind 3

pull/1711/head
IgnusG 3 years ago
parent 4d1c0b406b
commit 268441f33b

@ -2,16 +2,22 @@ module Docs
class Tailwindcss class Tailwindcss
class EntriesFilter < Docs::EntriesFilter class EntriesFilter < Docs::EntriesFilter
def get_type def get_type
# /customizing-colors rediects to /colors, hence making css # We are only interested in children list items
# selector below not to match the href selector = "nav li li a[href='#{result[:path]}']"
if result[:path] == 'customizing-colors'
selector = "#sidebar a[href='#{result[:path]}']" anchor = at_css(selector)
else category_list = anchor.ancestors('li')[1]
selector = "#sidebar a[href='#{result[:path]}']" title = category_list.css('h5')
return title.inner_text
end end
check = at_css(selector).parent.parent.parent.css('h5').inner_text def get_name
check # We are only interested in children list items
selector = "nav li li a[href='#{result[:path]}']"
item = at_css(selector)
return item.inner_text
end end
end end
end end

Loading…
Cancel
Save