Module: PDFThumbnail
Defined Under Namespace
Modules: Filters
Classes: Generator
Constant Summary
collapse
- CACHE_DIR =
"/assets/pdf_thumbnails/"
- HASH_LENGTH =
32
Instance Method Summary
collapse
Instance Method Details
#_dest_filename(src_path) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/jekyll-pdf-thumbnail.rb', line 11
def _dest_filename(src_path)
hash = Digest::SHA256.file(src_path)
short_hash = hash.hexdigest()[0, HASH_LENGTH]
"#{short_hash}.png"
end
|
#_must_create?(src_path, dest_path) ⇒ Boolean
25
26
27
28
|
# File 'lib/jekyll-pdf-thumbnail.rb', line 25
def _must_create?(src_path, dest_path)
!File.exist?(dest_path) || File.mtime(dest_path) <= File.mtime(src_path)
end
|