def testBuild(self): """ Test that we build the proper files. """ self.site.build() # Make sure we build to .build and not build self.assertEqual(os.path.exists(os.path.join(self.path, 'build')), False) self.assertEqual( sorted([ path_to_url(path) for path in fileList(os.path.join(self.path, '.build'), relative=True) ]), sorted([ 'error.html', 'index.html', 'robots.txt', 'sitemap.xml', self.site.get_url_for_static( '/static/css/style.css')[1:], # Strip the initial / self.site.get_url_for_static( '/static/images/favicon.ico')[1:], # Strip the initial / self.site.get_url_for_static('/static/js/main.js') [1:], # Strip the initial / ]))
def testBuild(self): """ Test that we build the proper files. """ self.site.build() # Make sure we build to .build and not build self.assertEqual(os.path.exists(os.path.join(self.path, 'build')), False) self.assertEqual( sorted([path_to_url(path) for path in fileList(os.path.join(self.path, '.build'), relative=True)]), sorted([ 'error.html', 'index.html', 'robots.txt', 'sitemap.xml', self.site.get_url_for_static('/static/css/style.css')[1:], # Strip the initial / self.site.get_url_for_static('/static/images/favicon.ico')[1:], # Strip the initial / self.site.get_url_for_static('/static/js/main.js')[1:], # Strip the initial / ]))
def url(self): """ We must use this when deploying, otherwise the paths will be broken when deploying from Windows """ return path_to_url(self.path)
def root_url(): logger.warning("%s:", page.path) logger.warning("{{ ROOT_URL }} is deprecated, use {% url '/page.html' %} instead.") return path_to_url(prefix)
def static_url(): logger.warning("%s:", page.path) logger.warning("{{ STATIC_URL }} is deprecated, use {% static '/static/path/to/file' %} instead.") return path_to_url(os.path.join(prefix, 'static'))
def root_url(): logger.warn("%s:", page.path) logger.warn("{{ ROOT_URL }} is deprecated, use {% url '/page.html' %} instead.") return path_to_url(prefix)
def static_url(): logger.warn("%s:", page.path) logger.warn("{{ STATIC_URL }} is deprecated, use {% static '/static/path/to/file' %} instead.") return path_to_url(os.path.join(prefix, 'static'))