Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(monorepo/{client,server}): loading of fonts
Elian Doranbe79eb41dac0
diff --git a/apps/server/src/public/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttf b/apps/client/src/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttfsimilarity index 100%rename from apps/server/src/public/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttfrename to apps/client/src/fonts/Inter/Inter-Italic-VariableFont_opsz,wght.ttfdiff --git a/apps/server/src/public/fonts/Inter/Inter-VariableFont_opsz,wght.ttf b/apps/client/src/fonts/Inter/Inter-VariableFont_opsz,wght.ttfsimilarity index 100%rename from apps/server/src/public/fonts/Inter/Inter-VariableFont_opsz,wght.ttfrename to apps/client/src/fonts/Inter/Inter-VariableFont_opsz,wght.ttfdiff --git a/apps/server/src/public/fonts/Inter/OFL.txt b/apps/client/src/fonts/Inter/OFL.txtsimilarity index 100%rename from apps/server/src/public/fonts/Inter/OFL.txtrename to apps/client/src/fonts/Inter/OFL.txtdiff --git a/apps/server/src/public/fonts/Inter/README.txt b/apps/client/src/fonts/Inter/README.txtsimilarity index 100%rename from apps/server/src/public/fonts/Inter/README.txtrename to apps/client/src/fonts/Inter/README.txtdiff --git a/apps/server/src/public/fonts/JetBrainsMono-Light.woff2 b/apps/client/src/fonts/JetBrainsMono-Light.woff2similarity index 100%rename from apps/server/src/public/fonts/JetBrainsMono-Light.woff2rename to apps/client/src/fonts/JetBrainsMono-Light.woff2diff --git a/apps/server/src/public/fonts/Montserrat-Light.ttf b/apps/client/src/fonts/Montserrat-Light.ttfsimilarity index 100%rename from apps/server/src/public/fonts/Montserrat-Light.ttfrename to apps/client/src/fonts/Montserrat-Light.ttfdiff --git a/apps/server/src/public/fonts/Montserrat-SemiBold.ttf b/apps/client/src/fonts/Montserrat-SemiBold.ttfsimilarity index 100%rename from apps/server/src/public/fonts/Montserrat-SemiBold.ttfrename to apps/client/src/fonts/Montserrat-SemiBold.ttfdiff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.cssindex aced7ab5d7..e9917b142f 100644--- a/apps/client/src/stylesheets/theme-next/base.css+++ b/apps/client/src/stylesheets/theme-next/base.css@@ -7,7 +7,7 @@@font-face {font-family: "Inter";- src: url(../../fonts/Inter/Inter-VariableFont_opsz\,wght.ttf);+ src: url(../../fonts/Inter/Inter-VariableFont_opsz,wght.ttf);}/*diff --git a/apps/client/webpack.config.js b/apps/client/webpack.config.jsindex 040160f301..d7892b3939 100644--- a/apps/client/webpack.config.js+++ b/apps/client/webpack.config.js@@ -56,6 +56,7 @@ module.exports = {"./src/assets","./src/stylesheets","./src/libraries",+ "./src/fonts"],styles: [],stylePreprocessorOptions: {diff --git a/apps/server/src/routes/assets.ts b/apps/server/src/routes/assets.tsindex fad77868ec..d5fc45f7ec 100644--- a/apps/server/src/routes/assets.ts+++ b/apps/server/src/routes/assets.ts@@ -36,6 +36,9 @@ async function register(app: express.Application) {app.use(`/${assetPath}/libraries`, proxy(publicUrl, {proxyReqPathResolver: (req) => "/libraries" + req.url}));+ app.use(`/${assetPath}/fonts`, proxy(publicUrl, {+ proxyReqPathResolver: (req) => "/fonts" + req.url+ }));app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "assets", "images")));} else {const clientStaticCache = persistentCacheStatic(path.join(resourceDir, "public"));@@ -43,9 +46,9 @@ async function register(app: express.Application) {app.use(`/${assetPath}/app-dist`, clientStaticCache);app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(resourceDir, "public", "stylesheets")));app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(resourceDir, "public", "libraries")));+ app.use(`/${assetPath}/fonts`, persistentCacheStatic(path.join(resourceDir, "public", "fonts")));app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(resourceDir, "assets", "images")));}- app.use(`/${assetPath}/fonts`, persistentCacheStatic(path.join(srcRoot, "public/fonts")));app.use(`/assets/vX/fonts`, express.static(path.join(srcRoot, "public/fonts")));app.use(`/assets/vX/images`, express.static(path.join(srcRoot, "..", "images")));app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets")));