Mercurial > piecrust2
diff piecrust/data/assetor.py @ 329:422052d2e978
internal: Try handling URLs in a consistent way.
* Now URLs passed to, and returned from, routes will always be absolute URLs,
i.e. URLs including the site root.
* Validate the site root at config loading time to make sure it starts and ends
with a slash.
* Get rid of unused stuff.
* Add tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 31 Mar 2015 23:03:28 -0700 |
parents | 9f3fc17e71e1 |
children | 0e9a94b7fdfa |
line wrap: on
line diff
--- a/piecrust/data/assetor.py Tue Mar 31 22:38:56 2015 -0700 +++ b/piecrust/data/assetor.py Tue Mar 31 23:03:28 2015 -0700 @@ -26,9 +26,8 @@ { '%path%': rel_assets_path, '%uri%': uri}) - # TEMP HACK - # TODO: looks like we can get here with differently formatted URLs... :( - return app.config.get('site/root') + base_url.strip('/') + '/' + + return base_url.rstrip('/') + '/' class Assetor(object):