Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assets path malfunction #44

Open
ain opened this issue Jul 14, 2016 · 5 comments
Open

assets path malfunction #44

ain opened this issue Jul 14, 2016 · 5 comments

Comments

@ain
Copy link
Member

ain commented Jul 14, 2016

Steps to reproduce:

  1. Add CSS file to app/styles/main.css

  2. Create index.hbs with:

    <!-- build:css(.tmp) {{assets}}styles/main.css -->
    <link rel="stylesheet" href="{{assets}}styles/main.css" type="text/css" media="all">
    <!-- endbuild --> 
  3. Create Gruntfile with path of assets and dest set to app/

  4. Compile

What happens: index.html comes across with

    <!-- build:css(.tmp) ..styles/main.css -->
    <link rel="stylesheet" href="..styles/main.css" type="text/css" media="all">
    <!-- endbuild -->

What should happen: valid relative path, e.g. styles/main.css or ./styles/main.css.

@assemblebot
Copy link

@ain Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

@jonschlinkert
Copy link
Member

You're missing a slash in your template after {{assets}}

@ain
Copy link
Member Author

ain commented Apr 28, 2017

@jonschlinkert I'm calling to reopen this ticket. As described, the configuration had the slash:

assemble: {
  options: {
    flatten: true,
    layoutext: '.hbs',
    assets: './app/'
  }
}

What it gives me is:

<script src="..scripts/vendor.js"></script>

Also, if I move slash from the config to the template, it gives me

<script src="../scripts/vendor.js"></script>

but it should be

<script src="./scripts/vendor.js"></script>

So the assets path calculation is certainly invalid here.

@ain
Copy link
Member Author

ain commented Apr 28, 2017

I was able to resolve the issue by duplicating the assets path!

assets: '<%= config.app %>/<%= config.app %>'

This pretty much reproduces the issue. I'm reopening the ticket.

@ain ain reopened this Apr 28, 2017
@ain ain changed the title asset option malfunction assets path malfunction Apr 28, 2017
@jonschlinkert
Copy link
Member

We can look into this, but it seems more likely that something is wrong in your config or templates, otherwise we would have gotten other issues about this by now.

Or maybe there is a bug with some combination of things that isn't common?

Can you provide the minimum necessary setup for us to reproduce the bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants