Skip to content

Commit 9a25c0d

Browse files
Emilio Del Tessandorosverrirs
authored andcommitted
serve --watch should now work
1 parent dd0d36f commit 9a25c0d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/jekyll-webp/webpGenerator.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ def generate(site)
6969
FileUtils::mkdir_p(imgdir_destination + imgfile_relative_path)
7070
outfile_fullpath_webp = File.join(imgdir_destination + imgfile_relative_path, outfile_filename)
7171

72+
# Keep the webp file from being cleaned by Jekyll
73+
site.static_files << WebpFile.new(site,
74+
site.dest,
75+
File.join(imgdir, imgfile_relative_path),
76+
outfile_filename)
77+
7278
# Check if the file already has a webp alternative?
7379
# If we're force rebuilding all webp files then ignore the check
7480
# also check the modified time on the files to ensure that the webp file
@@ -83,9 +89,6 @@ def generate(site)
8389

8490
# Generate the file
8591
WebpExec.run(@config['flags'], imgfile, outfile_fullpath_webp)
86-
87-
# Keep the webp file from being cleaned by Jekyll
88-
site.static_files << WebpFile.new(site, site.dest, imgdir, outfile_fullpath_webp)
8992
file_count += 1
9093

9194
end # dir.foreach

0 commit comments

Comments
 (0)