pelican-plugins icon indicating copy to clipboard operation
pelican-plugins copied to clipboard

assets plugin does not fill links (also fails test)

Open cycomanic opened this issue 6 years ago • 2 comments

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 avatar Feb 06 '18 15:02 cycomanic

@cycomanic: Were you able to find a solution to your problem here?

justinmayer avatar Mar 23 '18 11:03 justinmayer

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.

kdeldycke avatar Dec 10 '20 13:12 kdeldycke