@@ -18,7 +18,7 @@ def read
18
18
site . theme_list . each do |theme |
19
19
theme_layout_entries ( theme ) . each do |layout_file |
20
20
@layouts [ layout_name ( layout_file ) ] ||= \
21
- Layout . new ( site , theme_layout_directory ( theme ) , layout_file , theme )
21
+ Layout . new ( site , theme_layout_directory_for_theme ( theme ) , layout_file , theme )
22
22
end
23
23
end
24
24
@@ -29,7 +29,14 @@ def layout_directory
29
29
@layout_directory ||= site . in_source_dir ( site . config [ "layouts_dir" ] )
30
30
end
31
31
32
- def theme_layout_directory ( theme )
32
+ # NOTE: Returns only the site's theme layout path. However, this does not
33
+ # account for theme inheritance. Use `theme_layout_directory_for_theme`
34
+ # instead.
35
+ def theme_layout_directory
36
+ @theme_layout_directory ||= site . theme . layouts_path if site . theme
37
+ end
38
+
39
+ def theme_layout_directory_for_theme ( theme )
33
40
return nil unless theme
34
41
35
42
theme . layouts_path
@@ -42,8 +49,8 @@ def layout_entries
42
49
end
43
50
44
51
def theme_layout_entries ( theme )
45
- if theme_layout_directory ( theme )
46
- entries_in ( theme_layout_directory ( theme ) )
52
+ if theme_layout_directory_for_theme ( theme )
53
+ entries_in ( theme_layout_directory_for_theme ( theme ) )
47
54
else
48
55
[ ]
49
56
end
0 commit comments