diff --git a/resources/css/inter.css b/resources/css/inter.css index d13f6ecb3d7..37884842637 100644 --- a/resources/css/inter.css +++ b/resources/css/inter.css @@ -3,16 +3,16 @@ font-style: normal; font-weight: 100; font-display: swap; - src: url("/static/fonts/inter/Inter-Thin.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-Thin.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-Thin.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-Thin.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 100; font-display: swap; - src: url("/static/fonts/inter/Inter-ThinItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-ThinItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-ThinItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-ThinItalic.woff?v=3.15") format("woff"); } @font-face { @@ -20,16 +20,16 @@ font-style: normal; font-weight: 200; font-display: swap; - src: url("/static/fonts/inter/Inter-ExtraLight.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-ExtraLight.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-ExtraLight.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-ExtraLight.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 200; font-display: swap; - src: url("/static/fonts/inter/Inter-ExtraLightItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-ExtraLightItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-ExtraLightItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-ExtraLightItalic.woff?v=3.15") format("woff"); } @font-face { @@ -37,16 +37,16 @@ font-style: normal; font-weight: 300; font-display: swap; - src: url("/static/fonts/inter/Inter-Light.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-Light.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-Light.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-Light.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 300; font-display: swap; - src: url("/static/fonts/inter/Inter-LightItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-LightItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-LightItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-LightItalic.woff?v=3.15") format("woff"); } @font-face { @@ -54,16 +54,16 @@ font-style: normal; font-weight: 400; font-display: swap; - src: url("/static/fonts/inter/Inter-Regular.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-Regular.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-Regular.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-Regular.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 400; font-display: swap; - src: url("/static/fonts/inter/Inter-Italic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-Italic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-Italic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-Italic.woff?v=3.15") format("woff"); } @font-face { @@ -71,16 +71,16 @@ font-style: normal; font-weight: 500; font-display: swap; - src: url("/static/fonts/inter/Inter-Medium.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-Medium.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-Medium.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-Medium.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 500; font-display: swap; - src: url("/static/fonts/inter/Inter-MediumItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-MediumItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-MediumItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-MediumItalic.woff?v=3.15") format("woff"); } @font-face { @@ -88,16 +88,16 @@ font-style: normal; font-weight: 600; font-display: swap; - src: url("/static/fonts/inter/Inter-SemiBold.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-SemiBold.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-SemiBold.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-SemiBold.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 600; font-display: swap; - src: url("/static/fonts/inter/Inter-SemiBoldItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-SemiBoldItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-SemiBoldItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-SemiBoldItalic.woff?v=3.15") format("woff"); } @font-face { @@ -105,16 +105,16 @@ font-style: normal; font-weight: 700; font-display: swap; - src: url("/static/fonts/inter/Inter-Bold.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-Bold.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-Bold.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-Bold.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 700; font-display: swap; - src: url("/static/fonts/inter/Inter-BoldItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-BoldItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-BoldItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-BoldItalic.woff?v=3.15") format("woff"); } @font-face { @@ -122,16 +122,16 @@ font-style: normal; font-weight: 800; font-display: swap; - src: url("/static/fonts/inter/Inter-ExtraBold.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-ExtraBold.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-ExtraBold.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-ExtraBold.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 800; font-display: swap; - src: url("/static/fonts/inter/Inter-ExtraBoldItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-ExtraBoldItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-ExtraBoldItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-ExtraBoldItalic.woff?v=3.15") format("woff"); } @font-face { @@ -139,16 +139,16 @@ font-style: normal; font-weight: 900; font-display: swap; - src: url("/static/fonts/inter/Inter-Black.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-Black.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-Black.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-Black.woff?v=3.15") format("woff"); } @font-face { font-family: 'Inter'; font-style: italic; font-weight: 900; font-display: swap; - src: url("/static/fonts/inter/Inter-BlackItalic.woff2?v=3.15") format("woff2"), - url("/static/fonts/inter/Inter-BlackItalic.woff?v=3.15") format("woff"); + src: url("../fonts/inter/Inter-BlackItalic.woff2?v=3.15") format("woff2"), + url("../fonts/inter/Inter-BlackItalic.woff?v=3.15") format("woff"); } /* ------------------------------------------------------- @@ -166,7 +166,7 @@ Usage: font-display: swap; font-style: normal; font-named-instance: 'Regular'; - src: url("/static/fonts/inter/Inter-roman.var.woff2?v=3.15") format("woff2"); + src: url("../fonts/inter/Inter-roman.var.woff2?v=3.15") format("woff2"); } @font-face { font-family: 'Inter var'; @@ -174,7 +174,7 @@ Usage: font-display: swap; font-style: italic; font-named-instance: 'Italic'; - src: url("/static/fonts/inter/Inter-italic.var.woff2?v=3.15") format("woff2"); + src: url("../fonts/inter/Inter-italic.var.woff2?v=3.15") format("woff2"); } @@ -196,5 +196,5 @@ explicitly, e.g. font-weight: 100 900; font-display: swap; font-style: oblique 0deg 10deg; - src: url("/static/fonts/inter/Inter.var.woff2?v=3.15") format("woff2"); + src: url("../fonts/inter/Inter.var.woff2?v=3.15") format("woff2"); } diff --git a/resources/css/style.css b/resources/css/style.css index 3b206f947e9..da0a45cfa18 100644 --- a/resources/css/style.css +++ b/resources/css/style.css @@ -9,6 +9,6 @@ @import "./table.css"; @import "./datepicker.css"; @import "./highlight.css"; -@import "../../static/css/tailwind.core.css"; /* Build by gulp. Check `_buildTailwind` for more detail */ +@import "./tailwind.core.css"; /* Build by gulp. Check `_buildTailwind` for more detail */ @import "./common.css"; -@import "../../static/css/tailwind.build.css"; /* Build by gulp. Check `_buildTailwind` for more detail */ +@import "./tailwind.build.css"; /* Build by gulp. Check `_buildTailwind` for more detail */ diff --git a/resources/forge.config.js b/resources/forge.config.js index ae3f466e92c..8542bf290f7 100644 --- a/resources/forge.config.js +++ b/resources/forge.config.js @@ -2,7 +2,7 @@ const path = require('path') module.exports = { packagerConfig: { - icon: './icons/logseq.icns' + icon: './icons/logseq_big_sur.icns' }, makers: [ @@ -17,7 +17,7 @@ module.exports = { config: { background: './img/dmg-bg.png', format: 'ULFO', - icon: './icons/logseq.icns', + icon: './icons/logseq_big_sur.icns', name: 'Logseq' } }, diff --git a/src/main/frontend/config.cljs b/src/main/frontend/config.cljs index 562e6abad35..31a715220a2 100644 --- a/src/main/frontend/config.cljs +++ b/src/main/frontend/config.cljs @@ -31,8 +31,10 @@ (defn asset-uri [path] - (if dev? path - (str asset-domain path))) + (if (util/file-protocol?) + (string/replace path "/static/" "./") + (if dev? path + (str asset-domain path)))) (goog-define GITHUB_APP_NAME "logseq-test") diff --git a/src/main/frontend/util.cljc b/src/main/frontend/util.cljc index 621d8b4fdba..1a25d599c04 100644 --- a/src/main/frontend/util.cljc +++ b/src/main/frontend/util.cljc @@ -56,6 +56,11 @@ (let [ua (string/lower-case js/navigator.userAgent)] (string/includes? ua " electron")))) +#?(:cljs + (defn file-protocol? + [] + (string/starts-with? js/window.location.href "file://"))) + (defn format [fmt & args] #?(:cljs (apply gstring/format fmt args)