mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-07 05:05:10 -05:00
Don't generate excerpts for non-html pages (#8234)
Merge pull request 8234
This commit is contained in:
4
test/source/assets/test-styles.scss
Normal file
4
test/source/assets/test-styles.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
---
|
||||
|
||||
@import "{{ site.skin | default: 'grid' }}";
|
||||
@@ -816,7 +816,7 @@ class TestFilters < JekyllUnitTest
|
||||
"The list of grouped items for '' is not an Array."
|
||||
)
|
||||
# adjust array.size to ignore symlinked page in Windows
|
||||
qty = Utils::Platforms.really_windows? ? 16 : 18
|
||||
qty = Utils::Platforms.really_windows? ? 18 : 20
|
||||
assert_equal qty, g["items"].size
|
||||
end
|
||||
end
|
||||
@@ -1310,7 +1310,7 @@ class TestFilters < JekyllUnitTest
|
||||
"The list of grouped items for '' is not an Array."
|
||||
)
|
||||
# adjust array.size to ignore symlinked page in Windows
|
||||
qty = Utils::Platforms.really_windows? ? 16 : 18
|
||||
qty = Utils::Platforms.really_windows? ? 18 : 20
|
||||
assert_equal qty, g["items"].size
|
||||
end
|
||||
end
|
||||
|
||||
@@ -379,6 +379,13 @@ class TestPage < JekyllUnitTest
|
||||
test_page = Jekyll::Page.new(configured_site, source_dir, "/contacts", "bar.html")
|
||||
assert_equal "Contact Information\n", test_page.to_liquid["excerpt"]
|
||||
end
|
||||
|
||||
should "not expose an excerpt for non-html pages even in a configured site" do
|
||||
configured_site = fixture_site("page_excerpts" => true)
|
||||
test_page = Jekyll::Page.new(configured_site, source_dir, "assets", "test-styles.scss")
|
||||
refute_equal ".half { width: 50%; }\n", test_page.to_liquid["excerpt"]
|
||||
assert_nil test_page.to_liquid["excerpt"]
|
||||
end
|
||||
end
|
||||
|
||||
context "generated via plugin" do
|
||||
|
||||
@@ -241,6 +241,8 @@ class TestSite < JekyllUnitTest
|
||||
properties.html
|
||||
sitemap.xml
|
||||
static_files.html
|
||||
test-styles.css.map
|
||||
test-styles.scss
|
||||
trailing-dots...md
|
||||
)
|
||||
unless Utils::Platforms.really_windows?
|
||||
|
||||
Reference in New Issue
Block a user