Guest User

Untitled

a guest
Jun 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <%
  2. class Webby::Resources::Resource
  3.  
  4. def thumb_destination
  5. ::File.join(::Webby.site.output_dir, directory, 'thumbs', filename)
  6. return @thumb_destination unless @thumb_destination.nil?
  7.  
  8. @thumb_destination = ::File.join(::Webby.site.output_dir, directory, "thumbnails", filename)
  9. ext = extension
  10. unless ext.nil? or ext.empty?
  11. @thumb_destination << '-thumb.' << ext
  12. end
  13. @thumb_destination
  14. end
  15.  
  16. def thumb_url
  17. return @thumb_url unless @thumb_url.nil?
  18. @thumb_url = thumb_destination.sub(::Webby.site.output_dir, '')
  19. end
  20. end
  21. %>
Add Comment
Please, Sign In to add comment