Jump to content


Photo
- - - - -

I'd hope font awesome -urls would work after deploying from local to remote


  • Please log in to reply
11 replies to this topic

#1 ketri

ketri

    Super Member

  • Members

  • 172 posts
  • Country: Country Flag

Posted 24 March 2014 - 09:21 AM

Hi!

A problem I'm running into frequently is font awesome when working locally (http://www.pagelines...t-tips-for-dms/)
Is that after deploying my site (I use Git and Beanstalkapp for this ) the font awesome is not working on the remote live site. This is because it's trying to load font awesome from my local example.dev/wp-content/whatever/font-awesome.file and not the live sites example.com/wp-content/whatever/font-awesome.file

So it would be awesome if font awesome would load from /wp-content/themes/dms/fonts without the need to specify the home url of the site. Technically it should be pretty easy I'd imagine? And it would solve the problem of working locally. 

The problem with this is, that when I deploy my site and show it to a client, I'm still seeing  the font awesome because example.dev/wp-content/whatever/font-awesome.file loads for me and finds it! But for my client it won't show. So as I never see the problem I naturally  don't always remember to flush caches after deployment :)

Thank you very much!



#2 ketri

ketri

    Super Member

  • Members

  • 172 posts
  • Country: Country Flag

Posted 27 May 2014 - 07:36 PM

Any thoughts on this one?



#3 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 27 May 2014 - 07:44 PM

under Resets menu just click Flush button, all css will be rebuilt using correct urls.



#4 ketri

ketri

    Super Member

  • Members

  • 172 posts
  • Country: Country Flag

Posted 27 May 2014 - 07:48 PM

@Simon_P Thanks for the reply!

But is there any benefit from having the root of the url in the font awesome url?
So if we could have the exact same functionality and not have to flush the caches?

I even wonder if it would be a good idea to just use http://fortawesome.g...me/get-started/ first method here for pagelines? Updating future versions would just be changing few letters, no need to flush caches when migrating etc.

 



#5 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 27 May 2014 - 08:43 PM

the css url isnt the issue, its the path to the font that has changed. You should ALWAYS click the flush button when you migrate a site. If anything it makes sure everything is working as expected.

 

Check out this blog post on how to use domain names in local development so you dont have to change urls.

http://www.pagelines...t-tips-for-dms/



#6 ketri

ketri

    Super Member

  • Members

  • 172 posts
  • Country: Country Flag

Posted 27 May 2014 - 09:14 PM

I'm using CodeKit so unfortunately I have to change the urls. Fortunately there's an amazing plugin called WP Migrate DB that allows me to do that with such ease that it's no problem at all. I'm also using Git + Beanstalk for version control and deployments. 
Pretty much the only thing that's annoying me is the paths to Font Awesome not working after deployment as WP Migrate DB (and this whole workflow) is dependent on the files not including fixed urls, just the database. 

I'm just curious on would there be issues if the path to font awesome would be relative to whatever the root url is? Or would there be issues?

Thanks!



#7 ketri

ketri

    Super Member

  • Members

  • 172 posts
  • Country: Country Flag

Posted 24 September 2014 - 12:42 PM

@Simon_P

 

I still recommend you'd see if solution I recommended would be used in a future version of DMS. 
Just go and see how many developers in the DMS shop have their icons broken, very likely because of this. The problem is that the developer who work locally cannot see that the live site is broken because for them the fonts are loading from local urls.

Thanks!



#8 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 24 September 2014 - 01:12 PM

There is a link you can use to remote purge the CSS http://i.pagelines.c...ge/1I39252w0G2n

#9 ketri

ketri

    Super Member

  • Members

  • 172 posts
  • Country: Country Flag

Posted 24 September 2014 - 01:20 PM

Thanks Simon!

Will this slow down the loading of the site? Meaning, is this only for development purposes?

 



#10 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 24 September 2014 - 01:22 PM

Yes, the nocache thing is purely for development, LESS will recompile on every visit. But if you leave that off you can use the special purge link below.

#11 ketri

ketri

    Super Member

  • Members

  • 172 posts
  • Country: Country Flag

Posted 24 September 2014 - 01:41 PM

Thank you very much.
Still I'm wondering wouldn't it be easier just to have a hardcoded url for the font awesome, or even just use:

 
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

and never have to worry about the updares besides just updating the url in new versions of DMS?

Of course there might be stuff I won't understand, but just as a thought.


Edited by ketri, 24 September 2014 - 01:43 PM.


#12 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 24 September 2014 - 03:53 PM

We cant rely on external URLs. There are customers out there that use WordPress on an internal network.