pelican-plugins
pelican-plugins copied to clipboard
assets plugin does not fill links (also fails test)
The assets plugin does not seem to fill in the links for me. I've also run the test_assets.py and I get a failure on the relative and absolute link tests. Test failures below:
__________________________________________________________ TestWebAssetsRelativeURLS.test_template ___________________________________________________________
self = <assets.test_assets.TestWebAssetsRelativeURLS testMethod=test_template>
def test_template(self):
# Look in the output files for the link tag.
css_file = './theme/gen/style.{0}.min.css'.format(CSS_HASH)
html_files = ['index.html', 'archives.html',
'this-is-a-super-article.html']
for f in html_files:
> self.check_link_tag(css_file, os.path.join(self.temp_path, f))
test_assets.py:90:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_assets.py:57: in check_link_tag
self.assertRegexpMatches(html, link_tag)
E AssertionError: Regexp didn't match: '<link rel="stylesheet" href="./theme/gen/style.d91ae7af.min.css">' not found in
...
self = <assets.test_assets.TestWebAssetsAbsoluteURLS testMethod=test_absolute_url>
def test_absolute_url(self):
# Look in the output files for the link tag with absolute url.
css_file = ('http://localhost/theme/gen/style.{0}.min.css'
.format(CSS_HASH))
html_files = ['index.html', 'archives.html',
'this-is-a-super-article.html']
for f in html_files:
> self.check_link_tag(css_file, os.path.join(self.temp_path, f))
test_assets.py:112:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_assets.py:57: in check_link_tag
self.assertRegexpMatches(html, link_tag)
E AssertionError: Regexp didn't match: '<link rel="stylesheet" href="http://localhost/theme/gen/style.d91ae7af.min.css">'
@cycomanic: Were you able to find a solution to your problem here?
The legacy assets
plugin has been moved to a new dedicated repository at: https://github.com/pelican-plugins/webassets .
Please report there if you're still impacted by the issue. In the mean time, I guess this can be closed.