Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Need to be able to pass link attributes to the generated tag #19

Closed
mcordingley opened this issue Apr 9, 2014 · 19 comments
Closed

Need to be able to pass link attributes to the generated tag #19

mcordingley opened this issue Apr 9, 2014 · 19 comments

Comments

@mcordingley
Copy link
Contributor

Specifically, my print style-sheets are no longer targeted to media="print" and I have no way to fix this without dropping use of this code. :(

@ceesvanegmond
Copy link
Owner

I will look into that soon

@ceesvanegmond
Copy link
Owner

@mcordingley Could you check the develop branch? I've just pushed this feature. Can you check if this is what you're looking for? I als updated the README file on the develop branch.

@mcordingley
Copy link
Contributor Author

@ceesvanegmond Not quite. From looking at the code in there, you do have an $attributes property that seems to go into rendering the HTML tag, but it operates on an instance of the class. That's tricky to use when using this from the facade in a Laravel template or layout. At least from the perspective of using this from Laravel, I'd like to be able to do something like this:

{{ Minify::css(array('/css/some-library.css', '/css/screen.css'), array('media' => 'screen')) }}
{{ Minify::css('/css/print.css', array('media' => 'print')) }}

Emphasis is, of course, on that second parameter.

Does this make better sense? Apologies for how uninformative the first post was. It was late at night and I had just deployed some code that had used the older version of this. (And updated to this new version to try to handle some inexplicable JavaScript minification bug.)

@ceesvanegmond
Copy link
Owner

I can build it like you've described, but I wonder why you want it the way you've described it and the way it is right now. Can you explain yourself in more detail and the difference from your perspective?

@mcordingley
Copy link
Contributor Author

Would you be amenable to a phone conversation on it? I think we're each missing something that the other is trying to say and I find text to be awfully constricting when a conversation gets complex.

@ceesvanegmond
Copy link
Owner

I've updated the development branch to use your way. I do think this is an better way to set custom attributes. Could you test it for me?

@mcordingley
Copy link
Contributor Author

Thanks, and I sure can. I'll let you know once I have gotten it.

@mcordingley
Copy link
Contributor Author

Yup, working!

@mcordingley
Copy link
Contributor Author

One thing, not sure if this is a bug or intentional for testing purposes in your develop branch, but the concatenation/minification is happening for my "local" environment, which I have explicitly added to the configuration as one of the ignore_environments

@ceesvanegmond
Copy link
Owner

Ah! I see the problem, I forgot to add an return. I did that in the latest commit on the development branch. If it works I will merge it with master.

@mcordingley
Copy link
Contributor Author

I updated my local environment and visited a page on it. I am now correctly getting unminified files for local. (Yay!) I also commented out "local" in the ignore_environments array, so that it is now explicitly defined to be empty and tried loading the page again, but am still getting unminified code.

@ceesvanegmond
Copy link
Owner

Mm, when i comment out line config.php and that seems to work fine on my machine. Have you set the environment correctly?

@mcordingley
Copy link
Contributor Author

Yup, this is definitely "local" on my box. To be clear, I am setting
'ignore_environments' => array() in the Minify config file on my local
development environment and expecting Minify to output the built file
names but am instead getting the unminified component files.

On Mon, Apr 14, 2014 at 12:53 PM, Cees van Egmond
notifications@github.comwrote:

Mm, when i comment out line config.phphttps://github.com/ceesvanegmond/minify/blob/develop/src/config/config.php#L16and that seems to work fine on my machine. Have you set the environment
correctly?


Reply to this email directly or view it on GitHubhttps://github.com//issues/19#issuecomment-40390062
.

Michael Cordingley
740.707.7809

@mcordingley
Copy link
Contributor Author

Curiously, it still attempts to build the minified files; it just still outputs the individual tags. This is true whether "local" is commented out or not.

@mcordingley
Copy link
Contributor Author

Just made a new deployment to production. It does build and serve the minified files there. I wonder if there's some way that "local" is getting overridden to always do the full tags, in spite of what the config says, or if there's some issue where the config just isn't getting read.

http://imgur.com/y7Hm9

@ceesvanegmond
Copy link
Owner

I really dont know, I dont have that problem over here. Do you have any idea how come?

@ceesvanegmond
Copy link
Owner

I will close this issue, and merge develop with master. I've tested it on multilple Laravel builds and it works pretty well. Thx for the feedbak anyway!

@mcordingley
Copy link
Contributor Author

Sounds good. I'll try to run down what's happening on my end. Could just be some local misconfiguration or something. In any event, it's only a minor issue that I'm still experiencing, and it doesn't affect prod.

Thanks for all of your patience on this issue! 👍

@ceesvanegmond
Copy link
Owner

Your welcome. I've released an new version 2.0.2 where this feature is implemented. Again, many thanks!

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

No branches or pull requests

2 participants