Skip to content

Commit

Permalink
Merge pull request #302 from gi0baro/staticv_url
Browse files Browse the repository at this point in the history
Static versioning in URL() function
  • Loading branch information
mdipierro committed May 29, 2014
2 parents ceb479e + 2bf1f53 commit 91d6834
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gluon/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ def URL(
# if the url gets a static resource, don't force extention
if controller == 'static':
extension = None
# add static version to url
from globals import current
if hasattr(current, 'response'):
response = current.response
if response.static_version and response.static_version_urls:
args = [function] + args
function = '_'+str(response.static_version)

if '.' in function:
function, extension = function.rsplit('.', 1)
Expand Down

0 comments on commit 91d6834

Please sign in to comment.