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

feat: try fontaine #305

Merged
merged 2 commits into from
Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions blog-website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ts-check
const urlRegex = /^\/\d{4}\/\d{2}\/\d{2}\//;

const fontaine = require('fontaine');
const FontPreloadPlugin = require('webpack-font-preload-plugin');
const lightCodeTheme = require('prism-react-renderer/themes/nightOwl'); //github
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
Expand Down Expand Up @@ -88,6 +89,34 @@ const config = {
},
};
},
function fontainePlugin(_context, _options) {
return {
name: 'fontaine-plugin',
configureWebpack(_config, _isServer) {
return {
plugins: [
fontaine.FontaineTransform.webpack({
fallbacks: [
'system-ui',
'-apple-system',
'BlinkMacSystemFont',
'Segoe UI',
'Roboto',
'Oxygen',
'Ubuntu',
'Cantarell',
'Open Sans',
'Helvetica Neue',
'sans-serif',
],
// You may need to resolve assets like `/fonts/Roboto.woff2` to a particular directory
resolvePath: (id) => '../fonts/' + id,
}),
],
};
},
};
},
[
'ideal-image',
/** @type {import('@docusaurus/plugin-ideal-image').PluginOptions} */
Expand Down
1 change: 1 addition & 0 deletions blog-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "2.1.0",
"@tsconfig/docusaurus": "1.0.6",
"fontaine": "^0.1.2",
"typescript": "4.8.4"
},
"browserslist": {
Expand Down
2 changes: 1 addition & 1 deletion blog-website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
--ifm-footer-link-hover-color: #9998e2;

--ifm-code-font-size: 95%;
--ifm-font-family-base: 'Poppins';
--ifm-font-family-base: 'Poppins', 'Poppins override';
}

@font-face {
Expand Down
Loading