Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit dd6bb0d

Browse files
fix: fonts are inaccessible (fix #40)(#47)
1 parent 18b120e commit dd6bb0d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const removeMd = require('remove-markdown')
2-
2+
const path = require('path')
33
module.exports = (themeConfig, ctx) => {
44
themeConfig = Object.assign(themeConfig, {
55
nav: themeConfig.nav || [
@@ -79,6 +79,9 @@ module.exports = (themeConfig, ctx) => {
7979
? themeConfig.paginationComponent
8080
: 'Pagination',
8181
},
82+
alias: {
83+
fonts: path.resolve(__dirname, 'fonts'),
84+
},
8285
}
8386

8487
/**

styles/font.styl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
font-family: 'PT Serif';
44
font-style: normal;
55
font-weight: 400;
6-
src: local('PT Serif'), local('PTSerif-Regular'), url(/fonts/EJRVQgYoZZY2vCFuvAFbzr-_dSb_nco.woff2) format('woff2');
6+
src: local('PT Serif'), local('PTSerif-Regular'), url('~fonts/EJRVQgYoZZY2vCFuvAFbzr-_dSb_nco.woff2') format('woff2');
77
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
88
}
99
/* cyrillic */
1010
@font-face {
1111
font-family: 'PT Serif';
1212
font-style: normal;
1313
font-weight: 400;
14-
src: local('PT Serif'), local('PTSerif-Regular'), url(/fonts/EJRVQgYoZZY2vCFuvAFSzr-_dSb_nco.woff2) format('woff2');
14+
src: local('PT Serif'), local('PTSerif-Regular'), url('~fonts/EJRVQgYoZZY2vCFuvAFSzr-_dSb_nco.woff2') format('woff2');
1515
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
1616
}
1717
/* latin-ext */
1818
@font-face {
1919
font-family: 'PT Serif';
2020
font-style: normal;
2121
font-weight: 400;
22-
src: local('PT Serif'), local('PTSerif-Regular'), url(/fonts/EJRVQgYoZZY2vCFuvAFYzr-_dSb_nco.woff2) format('woff2');
22+
src: local('PT Serif'), local('PTSerif-Regular'), url('~fonts/EJRVQgYoZZY2vCFuvAFYzr-_dSb_nco.woff2') format('woff2');
2323
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
2424
}
2525
/* latin */
2626
@font-face {
2727
font-family: 'PT Serif';
2828
font-style: normal;
2929
font-weight: 400;
30-
src: local('PT Serif'), local('PTSerif-Regular'), url(/fonts/EJRVQgYoZZY2vCFuvAFWzr-_dSb_.woff2) format('woff2');
30+
src: local('PT Serif'), local('PTSerif-Regular'), url('~fonts/EJRVQgYoZZY2vCFuvAFWzr-_dSb_.woff2') format('woff2');
3131
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
3232
}

0 commit comments

Comments
 (0)