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

cebong: Removed unused font imports #640

Merged
merged 1 commit into from
Apr 16, 2019
Merged

cebong: Removed unused font imports #640

merged 1 commit into from
Apr 16, 2019

Conversation

baryluk
Copy link
Contributor

@baryluk baryluk commented Mar 26, 2019

It just adds to network roundtrips. Browser will download them even if they are not used. At least the CSS files will be downloaded (and will actually block other processing!). In some case browser will also download actual font files, even if they are not used, but this will usually be done asynchronously or after page is finished loading. But most of the time it is just a waste of bandwidth (but they are cached for 1y and could be used on other websites).

As a bonus I fixed some quotation issues of urls, because this is what I see in css documentation - https://developer.mozilla.org/en-US/docs/Web/CSS/@import

Next improvement would be to move this @url import into separate link statement in base.html, this way things can proceed in parallel more smoothly.

        <link rel="stylesheet" href="https://fonts.googleapis.com/css?subset=latin&family=Crimson+Text:400,400italic,600,600italic,700,700italic" type="text/css" importance="low" referrerpolicy="no-referrer" />

After that, and margin all css files, this would be really clean and fast theme! :)

PS. Google Fonts Service API allows fetching multiple css files together:

        <link rel="stylesheet" href="https://fonts.googleapis.com/css?subset=latin&family=Yanone+Kaffeesatz|Crimson+Text:400,400italic,600,600italic,700,700italic|Droid+Sans+Mono" type="text/css" importance="low" referrerpolicy="no-referrer" />

(and similarly using @import url).

It just adds to network roundtrips. Browser will download them even if they are not used. At least the CSS files will be downloaded (and will actually block other processing!). In some case browser will also download actual font files, even if they are not used, but this will usually be done asynchronously or after page is finished loading. But most of the time it is just a waste of bandwidth (but they are cached for 1y and could be used on other websites).

As a bonus I fixed some quotation issues of urls, because this is what I see in css documentation - https://developer.mozilla.org/en-US/docs/Web/CSS/@import

Next improvement would be to move this `@url import` into separate `link` statement in `base.html`, this way things can proceed in parallel more smoothly.

```html
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?subset=latin&family=Crimson+Text:400,400italic,600,600italic,700,700italic" type="text/css" importance="low" referrerpolicy="no-referrer" />
```

After that, and margin all `css` files, this would be really clean and fast theme! :)

PS. Google Fonts Service API allows fetching multiple css files together:


```html
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?subset=latin&family=Yanone+Kaffeesatz|Crimson+Text:400,400italic,600,600italic,700,700italic|Droid+Sans+Mono" type="text/css" importance="low" referrerpolicy="no-referrer" />
```

(and similarly using `@import url`).
@justinmayer
Copy link
Member

Thank you for the enhancement, Witold.

@justinmayer justinmayer changed the title Removed unused imports for fonts in cebong cebong: Removed unused font imports Apr 16, 2019
@justinmayer justinmayer merged commit 74be1a6 into getpelican:master Apr 16, 2019
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 this pull request may close these issues.

2 participants