On Friday, December 8, 2017 at 1:06:35 PM UTC+3, T.R.Rajkumar wrote:
>
> I have an application. The views extend layout.html. When there is no 
> internet connection my pages wait for fonts.googleapis.com
> I dont want that to happen. How to remove the dependecy on 
> fonts.gooleapis.com
>
hI! 
1  get downloader  (google-font-download  - bash script)
git clone https://github.com/neverpanic/google-font-download
2 view fonts in 
/home/w2p/web2py/applications/myapp/static/css/bootstrap.min.css
@import 
url("https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700";)
3 mkdir /home/w2p/mygoogfont
   cd /home/w2p/mygoogfont
   get fonts (with your locale ! mylocale - cyrillic)
./google-font-download  "Open Sans:300" "Open Sans:400" "Open Sans:700" 
"Open Sans:300italic" "Open Sans:400italic"  "Open Sans:700italic" 
-lcyrillic,latin
4  cp font.css   /home/w2p/web2py/applications/myapp/static/css
and change import string in bootstrap.min.css   @import url("font.css");
5  add to nginx 
location ~* ^/(.*)\/static\/css\/(.*)\.(woff|eot|ttf|woff2)$ {
    alias /home/w2p/mygoogfont/$2.$3;
    #https://www.regexpal.com/93773
    add_header Pragma public;
    add_header Access-Control-Allow-Origin "*";
    expires 30d;
}

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to