Skip to content

Commit

Permalink
Static hosting of google fonts (#1608)
Browse files Browse the repository at this point in the history
Close #1607
  • Loading branch information
cw789 authored Sep 18, 2022
1 parent dd4f391 commit 9092457
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const htmlBuild = esbuild.build({
],
loader: {
'.woff2': 'file',
// TODO: Remove when @fontsource/* removes legacy .woff
'.woff': 'file',
},
}).catch(() => process.exit(1))

Expand Down
7 changes: 6 additions & 1 deletion assets/css/_html.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
@import url('https://fonts.googleapis.com/css?family=Lato:300,700|Merriweather:300italic,300|Inconsolata:400,700');
@import '@fontsource/lato/300.css';
@import '@fontsource/lato/700.css';
@import '@fontsource/merriweather/300.css';
@import '@fontsource/merriweather/300-italic.css';
@import '@fontsource/inconsolata/400.css';
@import '@fontsource/inconsolata/700.css';

@import 'custom-props/common.css';
@import 'custom-props/theme-light.css';
Expand Down
39 changes: 39 additions & 0 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"homepage": "https://github.com/elixir-lang/ex_doc#readme",
"browserslist": "last 2 versions",
"devDependencies": {
"@fontsource/inconsolata": "^4.5.7",
"@fontsource/lato": "^4.5.9",
"@fontsource/merriweather": "^4.5.13",
"esbuild": "^0.15.7",
"eslint": "^8.23.1",
"eslint-config-standard": "^17.0.0",
Expand Down

0 comments on commit 9092457

Please sign in to comment.