Skip to content

Commit 4e625d4

Browse files
Replace Google Font with local variable font (#1910)
* Removed the Google OpenSans with fontsource/open-sans * Placed the fonts inside the project directory itself * Fixed the fonts not being read * Removed redundant fonts, and also removed css/fonts * Changed the font-weight (100 to 700) range * correct font family name and remove ttf font files * correcting italic font file name * Removed ttf fonts and renamed the font fileNames for simplicity * font imports removed from style.css * fix: path fix and font preload * fix: fixed fonts.css order * chore: removed additional whitespaces --------- Co-authored-by: shubham oulkar <91728992+ShubhamOulkar@users.noreply.github.com>
1 parent fc56d27 commit 4e625d4

6 files changed

Lines changed: 53 additions & 14 deletions

File tree

_includes/head.html

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,72 @@
22
<title>{{ page.title }}</title>
33
<meta charset="utf-8">
44
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
<link
6+
rel="preload"
7+
href="/fonts/open-sans/woff2/OpenSans.woff2"
8+
as="font"
9+
type="font/woff2"
10+
crossorigin
11+
/>
12+
<link
13+
rel="preload"
14+
href="/fonts/open-sans/woff2/OpenSans-Italic.woff2"
15+
as="font"
16+
type="font/woff2"
17+
crossorigin
18+
/>
19+
<link
20+
href="/fonts/open-sans/woff/OpenSans.woff"
21+
as="font"
22+
type="font/woff"
23+
crossorigin
24+
/>
25+
<link
26+
href="/fonts/open-sans/woff/OpenSans-Italic.woff"
27+
as="font"
28+
type="font/woff"
29+
crossorigin
30+
/>
31+
<link rel="stylesheet" href="/fonts/open-sans/fonts.css" />
532
<link rel="icon" type="image/png" href="/images/favicon.png" />
633
<script data-cfasync="false" src="/js/theme.js"></script>
734
<link rel="stylesheet" href="/css/variables.css?_={{ site.time | date: '%s' }}">
835
<link rel="stylesheet" href="/css/themes/dark-theme.css?_={{ site.time | date: '%s' }}">
936
<link rel="stylesheet" href="/css/style.css?_={{ site.time | date: '%s' }}">
1037
<link rel="stylesheet" href="/css/sintax.css?_={{ site.time | date: '%s' }}">
11-
1238
<link rel="stylesheet" href="/css/font-awesome.min.css">
13-
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&amp;amp;subset=latin,latin-ext">
1439
<link rel="stylesheet" href="/css/langs/{{ page.lang }}.css">
15-
1640
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
1741
<meta name="description" content="{{page.description}}">
1842
<meta property="og:url" content="https://expressjs.com{{page.url}}">
19-
2043
{% if page.author %}
21-
<meta property="og:type" content="article" >
44+
<meta property="og:type" content="article">
2245
<meta property="og:article:author" content="{{page.author}}">
2346
{% else %}
24-
<meta property="og:type" content="website" >
47+
<meta property="og:type" content="website">
2548
{% endif %}
26-
2749
<meta name="title" property="og:title" content="{{page.title}}">
2850
<meta property="og:description" content="{{page.description}}">
2951
{% if page.image %}
30-
<meta property="og:image" content="{{page.image}}" >
52+
<meta property="og:image" content="{{page.image}}">
3153
{% else %}
32-
<meta property="og:image" content="https://expressjs.com/images/og.png" >
54+
<meta property="og:image" content="https://expressjs.com/images/og.png">
3355
{% endif %}
3456
<meta name="twitter:card" content="summary_large_image">
3557
<meta property="twitter:domain" content="expressjs.com">
3658
<meta property="twitter:url" content="https://expressjs.com{{page.url}}">
3759
<meta name="twitter:title" content="{{page.title}}">
3860
<meta name="twitter:description" content="{{page.description}}">
3961
{% if page contains "image" %}
40-
<meta property="twitter:image" content="{{ page.image }}" >
62+
<meta property="twitter:image" content="{{ page.image }}">
4163
{% else %}
42-
<meta property="twitter:image" content="https://expressjs.com/images/og.png" >
64+
<meta property="twitter:image" content="https://expressjs.com/images/og.png">
4365
{% endif %}
44-
4566
<script data-cfasync="false" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
4667
<script data-cfasync="false" src="/js/app.js"></script>
4768
<script data-cfasync="false" defer src="/js/menu.js"></script>
4869
<script data-cfasync="false" defer src="/js/copycode.js"></script>
4970
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
50-
5171
<link rel="alternate" type="application/atom+xml" href="/feed.xml" title="Express Blog" />
5272
<link rel="alternate" type="application/atom+xml" href="/vulnerabilities.xml" title="Express Vulnerabilities" />
53-
</head>
73+
</head>

fonts/open-sans/fonts.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@font-face {
2+
font-family: "Open Sans";
3+
font-style: normal;
4+
font-weight: 100 700;
5+
font-display: swap;
6+
src: local("Open Sans"),
7+
url("./woff2/OpenSans.woff2") format("woff2"),
8+
url("./woff/OpenSans.woff") format("woff"),
9+
}
10+
11+
@font-face {
12+
font-family: "Open Sans";
13+
font-style: italic;
14+
font-weight: 100 700;
15+
font-display: swap;
16+
src: local("Open Sans"),
17+
url("./woff2/OpenSans-Italic.woff2") format("woff2"),
18+
url("./woff/OpenSans-Italic.woff") format("woff"),
19+
}
381 KB
Binary file not shown.

fonts/open-sans/woff/OpenSans.woff

338 KB
Binary file not shown.
305 KB
Binary file not shown.
273 KB
Binary file not shown.

0 commit comments

Comments
 (0)