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

Add options for defer async etc. #5

Closed
pfrlv opened this issue Jan 20, 2020 · 4 comments · Fixed by #7
Closed

Add options for defer async etc. #5

pfrlv opened this issue Jan 20, 2020 · 4 comments · Fixed by #7

Comments

@pfrlv
Copy link

pfrlv commented Jan 20, 2020

Maybe you should add $options = [] to the mix function? I can make PR

@RobertCordes
Copy link
Member

What do you think would be the better approach:

  1. Add options to the mix function
  2. Add a new function that only returns the path instead of the whole HTML tag

I'm currently leaning more towards option 2. It could be used like this:

<script src="<?php echo mixPath('/main.js') ?>" async>

What's your opinion on this?

@jonasfeige
Copy link

I much prefer option 2 as well. Makes things less abstract.

@arnoson
Copy link
Contributor

arnoson commented Aug 4, 2020

I tend to option 1 making the function behave like kirby's js() and css() helpers. Maybe it could be as simple as forwarding the options array to the helper functions?

@RobertCordes
Copy link
Member

Thanks, @arnoson, didn’t think of that.

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

Successfully merging a pull request may close this issue.

4 participants