@@ -16,7 +16,8 @@ preprocess do
16
16
17
17
@config [ :favicon_reprs ] = favicon_reprs
18
18
19
- @config [ :feed_book_identifiers ] = feed_books . map ( &:identifier )
19
+ @config [ :feed_book_isbn ] = feed_books . map { |book | book [ :isbn ] }
20
+ @config [ :recent_book_isbn ] = recent_books . map { |book | book [ :isbn ] }
20
21
21
22
missing_covers = 0
22
23
@@ -113,9 +114,11 @@ compile '/static/**/*' do
113
114
# don't filter or layout
114
115
end
115
116
116
- # FIXME avoid if not in recent books
117
117
%i[ mini medium default ] . each do |repr |
118
118
compile '/cover/**/*' , rep : repr do
119
+ isbn = item . identifier . without_exts . split ( '/' ) [ -1 ]
120
+ next if repr == :medium && !@config [ :recent_book_isbn ] . include? ( isbn )
121
+
119
122
width = @config [ :cover ] [ :width ] [ repr ]
120
123
filter :thumbnailize , width : width unless @config [ :dev ]
121
124
@@ -125,14 +128,13 @@ end
125
128
end
126
129
127
130
compile '/book/**/*' , rep : :feed do
128
- if @config [ :feed_book_identifiers ] . include? ( item . identifier )
129
- filter :erb
130
- filter :kramdown if item [ :extension ] == 'md'
131
- filter :html_compressor , type : item [ :extension ] unless @config [ :dev ]
131
+ next unless @config [ :feed_book_isbn ] . include? ( item [ :isbn ] )
132
+ filter :erb
133
+ filter :kramdown if item [ :extension ] == 'md'
134
+ filter :html_compressor , type : item [ :extension ] unless @config [ :dev ]
132
135
133
- layout '/feed_entry.*'
134
- snapshot :feed
135
- end
136
+ layout '/feed_entry.*'
137
+ snapshot :feed
136
138
137
139
# do not write/route such representation
138
140
write nil
0 commit comments