History

Bypass old tailwind redirects

IgnusG committed 4 years ago

Commit 643e24f1 parent 30eb2061 file · +20 −9Browse files

Unified · Split

lib/docs/scrapers/tailwindcss.rb+20−9
@@ -11,15 +11,26 @@ module Docs · 10 unmodified lines
11 11
12 # options[:container] = 'body';12 # options[:container] = 'body';
13 13
14 options[:skip_patterns] = [14 # Fix redirects from older tailwind 2 docs
15 15 options[:fix_urls] = lambda do |url|
16 # removed because it focuses on how to use Tailwind with some other niche16 if url.include? "installation/"
17 # technologies and to also align with DevDoc's Vision, which is" to:"17 break "/docs/installation"
18 # "indexing only the minimum useful to most developers" that use Tailwind18 end
19 %r{\/guides\/.*},19
20 20 if url.end_with? "/breakpoints"
21 # removed so it is easy to "get_type" (see tailwindcss/entries.rb line #15)21 break "/docs/screens#{/#.*$/.match(url)}"
22 %r{\/colors\z}22 end
23 if url.end_with? "/adding-base-styles"
24 break "/docs/adding-custom-styles#adding-base-styles"
25 end
26 if url.end_with? "/ring-opacity"
27 break "/docs/ring-color#changing-the-opacity"
28 end
29
30 if url.match(/\/colors#?/)
31 break "/docs/customizing-colors#{/#.*$/.match(url)}"
32 end
33 end
23 34
24 options[:skip_patterns] = [35 options[:skip_patterns] = [
25 # Skip setup instructions36 # Skip setup instructions

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t