-
Notifications
You must be signed in to change notification settings - Fork 72
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
prepend website url to the font name #22
base: master
Are you sure you want to change the base?
Conversation
Interesting idea, but I'm wondering why you're not just putting the CSS on |
Good point. Could be done that way. It's a larger federated project, so we used a subdomain to host common resources. I thought of different use case that might have more value.... I concatenate all core |
OK, I see that use case and am willing to accept this patch, but I'm not convinced However, I don't like that the generated output CSS file would then not work in-place, i.e. if you were to generate a CSS file with this parameter and attempted to use it without modifications in a web page, it would not work. So I'm thinking maybe the better approach would be to support putting the fonts into a subfolder, i.e. making this parameter also affect the path where the fonts would be stored and call it |
I like your idea of The I actually already mimic And this is perfect I think for simple websites. But once concatenation of css files occurs, then I will try to explain by using one of my websites as an example. For tigsus.com, there are font dependencies on...
And then for site-layout, third party assets are isolated from local assets or sub-sections.
For example, during development, I may use combined-font-local.css but then in production I use a concatenated/combined file in combined-local.css. Then in my setup scripts for fonts, I declare various types of css types. URL_FONTS_LOCAL="/public/_fonts"
URL_FONTS_DEV="//dev.public-url.com:8401/public/_fonts"
URL_FONTS_PROTO="//proto.public-url.com/public/_fonts"
URL_FONTS_PROD="//public-url.com/public/_fonts"
URL_FONTS_AWS="//cdn-public/_fonts" The script automatically creates font/css directories and So.... if But also my example is most likely in the minority. Adding |
With some retooling for my complex example, what might work is using a combination of For example, run
This is created:
Then the font urls inside the generated output CSS file should work in place without resorting to multiple specialized url prefixes (eg |
@neverpanic Will this be merged? We also have the case of locally hosting but on an independent subdomain. Another case is if we want to combine / minify the font css, relative paths will lose the font file location. |
Hello. Very convenient bash script that you wrote here. Thank you.
My project required self-hosting of fonts for multiple subdomains. I added the
website
parameter to prepend the url to the font name so it gets saved to font.css asurl('https://example.com/fonts/FONT-NAME.woff2')
.Just a simple convenience parameter. If you don't want to include it, that's okay and I'll delete the pull request. But if you do, great.