File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
spec/jekyll_redirect_from Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ lib/bundler/man
1212pkg
1313rdoc
1414spec /reports
15+ spec /fixtures /.jekyll-metadata
1516test /tmp
1617test /version_tmp
1718tmp
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ class Redirector < Jekyll::Generator
44
55 def generate ( site )
66 original_pages = site . pages . dup
7- generate_alt_urls ( site , site . posts )
7+ generate_alt_urls ( site , site . posts ) if Jekyll :: VERSION < '3.0.0'
88 generate_alt_urls ( site , original_pages )
99 generate_alt_urls ( site , site . docs_to_write )
1010 end
@@ -38,9 +38,10 @@ def generate_alt_urls(site, list)
3838 end
3939
4040 def is_dynamic_document? ( page_or_post )
41- page_or_post . is_a? ( Jekyll ::Post ) ||
42- page_or_post . is_a? ( Jekyll ::Page ) ||
43- page_or_post . is_a? ( Jekyll ::Document )
41+ page_or_post . is_a? ( Jekyll ::Page ) ||
42+ page_or_post . is_a? ( Jekyll ::Document ) ||
43+ ( Jekyll ::VERSION < '3.0.0' &&
44+ page_or_post . is_a? ( Jekyll ::Post ) )
4445 end
4546
4647 def has_alt_urls? ( page_or_post )
Original file line number Diff line number Diff line change 1111 let ( :page_with_many_redirect_to ) { setup_page ( "multiple_redirect_tos.md" ) }
1212
1313 it "knows if a page or post is requesting a redirect page" do
14- expect ( redirector . has_alt_urls? ( post_to_redirect ) ) . to be_truthy
14+ if Jekyll ::VERSION < '3.0.0'
15+ expect ( redirector . has_alt_urls? ( post_to_redirect ) ) . to be_truthy
16+ else
17+ skip "Don't need to test posts in Jekyll 3"
18+ end
1519 end
1620
1721 it "knows if a document is requesting a redirect page" do
You can’t perform that action at this time.
0 commit comments