mirror of
https://github.com/penpot/penpot.git
synced 2026-03-27 22:00:35 +01:00
🐛 Fix regression on subpath support (#8793)
This commit is contained in:
@@ -9,6 +9,10 @@ localhost:3449 {
|
||||
}
|
||||
|
||||
http://localhost:3450 {
|
||||
# For subpath test
|
||||
# handle_path /penpot/* {
|
||||
# reverse_proxy localhost:4449
|
||||
# }
|
||||
reverse_proxy localhost:4449
|
||||
}
|
||||
|
||||
|
||||
@@ -179,12 +179,11 @@
|
||||
([media]
|
||||
(resolve-file-media media false))
|
||||
([{:keys [id data-uri] :as media} thumbnail?]
|
||||
(if data-uri
|
||||
data-uri
|
||||
(dm/str
|
||||
(cond-> (u/join public-uri "assets/by-file-media-id/")
|
||||
(true? thumbnail?) (u/join (dm/str id "/thumbnail"))
|
||||
(false? thumbnail?) (u/join (dm/str id)))))))
|
||||
(or data-uri
|
||||
(dm/str
|
||||
(cond-> (u/join public-uri "assets/by-file-media-id/")
|
||||
(true? thumbnail?) (u/join (dm/str id "/thumbnail"))
|
||||
(false? thumbnail?) (u/join (dm/str id)))))))
|
||||
|
||||
(defn resolve-href
|
||||
[resource]
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
(:require-macros [app.main.style :as stl])
|
||||
(:require
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.uri :as u]
|
||||
[app.config :as cf]
|
||||
[app.main.data.common :as dcm]
|
||||
[app.main.data.dashboard :as dd]
|
||||
@@ -95,8 +96,8 @@
|
||||
(mf/defc card-item
|
||||
{::mf/wrap-props false}
|
||||
[{:keys [item index is-visible collapsed on-import]}]
|
||||
(let [id (dm/str "card-container-" index)
|
||||
thb (assoc cf/public-uri :path (dm/str "/images/thumbnails/template-" (:id item) ".jpg"))
|
||||
(let [id (dm/str "card-container-" index)
|
||||
href (u/join cf/public-uri (dm/str "images/thumbnails/template-" (:id item) ".jpg"))
|
||||
hover? (mf/use-state false)
|
||||
|
||||
on-click
|
||||
@@ -124,7 +125,7 @@
|
||||
:on-mouse-leave #(reset! hover? false)
|
||||
:on-key-down on-key-down}
|
||||
[:div {:class (stl/css :img-container)}
|
||||
[:img {:src (dm/str thb)
|
||||
[:img {:src (dm/str href)
|
||||
:alt (:name item)
|
||||
:loading "lazy"
|
||||
:decoding "async"}]]
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
(defn- google-font-id->uuid
|
||||
"Returns the UUID for a Google Font ID. Uses uuid/zero as fallback when the
|
||||
font is not found in fontsdb. uuid/zero maps to the default font (Source
|
||||
font is not found in fontsdb. uuid/zero maps to the default font (Source
|
||||
Sans Pro) in WASM.
|
||||
A font id may not exist for different reasons:
|
||||
- the gfonts.json catalog was updated and fonts were renamed or removed,
|
||||
@@ -152,7 +152,7 @@
|
||||
[font-id font-variant-id font-weight font-style]
|
||||
(let [variant (font-db-data font-id font-variant-id font-weight font-style)]
|
||||
(if-let [ttf-url (:ttf-url variant)]
|
||||
(str/replace ttf-url "https://fonts.gstatic.com/s/" (u/join cf/public-uri "/internal/gfonts/font/"))
|
||||
(str/replace ttf-url "https://fonts.gstatic.com/s/" (u/join cf/public-uri "internal/gfonts/font/"))
|
||||
nil)))
|
||||
|
||||
(defn- font-id->ttf-url
|
||||
|
||||
Reference in New Issue
Block a user