Skip to content

Commit

Permalink
Add thumbnail use for imgur
Browse files Browse the repository at this point in the history
This makes the search page much easier to load. -POLM
  • Loading branch information
polm committed Feb 8, 2016
1 parent 15b041f commit 367ec60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/search.ls
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ make-embed = (entry) ->
out += '<div class="summary-small">'
out +='<div class=\"imgwrapper\" '
if entry.image
out += "style=\"background-image: url(#{entry.image})\""
url = entry.image
# use small thumbnail if we've got imgur
# A more general solution would be nice...
if /imgur.com/.test entry.image
url = (url.substr 0, (url.length - 5)) + \s.jpg
out += "style=\"background-image: url(#{url})\""
out += "></div>"
out += "<h2>#{entry.title}</h2>"
out += "<p>#{entry.description}</p>"
Expand Down

0 comments on commit 367ec60

Please sign in to comment.