mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-03-31 00:37:45 +02:00
Assets path, re-add async, fix z
This commit is contained in:
parent
7b4a047d90
commit
f32190bde9
6 changed files with 12 additions and 12 deletions
2
assets/package-lock.json
generated
2
assets/package-lock.json
generated
|
@ -28,7 +28,7 @@
|
||||||
"eslint-plugin-jest-dom": "^5.4.0",
|
"eslint-plugin-jest-dom": "^5.4.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-fetch-mock": "^3.0.3",
|
"jest-fetch-mock": "^3.0.3",
|
||||||
"ts-jest": "^29.1.2z"
|
"ts-jest": "^29.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@adobe/css-tools": {
|
"node_modules/@adobe/css-tools": {
|
||||||
|
|
|
@ -33,6 +33,6 @@
|
||||||
"eslint-plugin-jest-dom": "^5.4.0",
|
"eslint-plugin-jest-dom": "^5.4.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-fetch-mock": "^3.0.3",
|
"jest-fetch-mock": "^3.0.3",
|
||||||
"ts-jest": "^29.1.2z"
|
"ts-jest": "^29.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,9 +51,9 @@ export default defineConfig(({ command }: ConfigEnv): UserConfig => {
|
||||||
...Object.fromEntries(themes)
|
...Object.fromEntries(themes)
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
entryFileNames: 'assets/[name].js',
|
entryFileNames: '[name].js',
|
||||||
chunkFileNames: '[name].js',
|
chunkFileNames: '[name].js',
|
||||||
assetFileNames: 'assets/[name][extname]'
|
assetFileNames: '[name][extname]'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,7 +19,7 @@ html lang="en"
|
||||||
meta name="theme-color" content="#618fc3"
|
meta name="theme-color" content="#618fc3"
|
||||||
meta name="format-detection" content="telephone=no"
|
meta name="format-detection" content="telephone=no"
|
||||||
= csrf_meta_tag()
|
= csrf_meta_tag()
|
||||||
script type="module" src=Routes.static_path(@conn, "/assets/js/app.js")
|
script type="module" src=Routes.static_path(@conn, "/js/app.js") async="async"
|
||||||
= render PhilomenaWeb.LayoutView, "_opengraph.html", assigns
|
= render PhilomenaWeb.LayoutView, "_opengraph.html", assigns
|
||||||
body data-theme=theme_name(@current_user)
|
body data-theme=theme_name(@current_user)
|
||||||
= render PhilomenaWeb.LayoutView, "_burger.html", assigns
|
= render PhilomenaWeb.LayoutView, "_burger.html", assigns
|
||||||
|
|
|
@ -65,16 +65,16 @@ defmodule PhilomenaWeb.LayoutView do
|
||||||
end
|
end
|
||||||
|
|
||||||
def stylesheet_path(conn, %{theme: "dark"}),
|
def stylesheet_path(conn, %{theme: "dark"}),
|
||||||
do: Routes.static_path(conn, "/assets/css/dark.css")
|
do: Routes.static_path(conn, "/css/dark.css")
|
||||||
|
|
||||||
def stylesheet_path(conn, %{theme: "red"}),
|
def stylesheet_path(conn, %{theme: "red"}),
|
||||||
do: Routes.static_path(conn, "/assets/css/red.css")
|
do: Routes.static_path(conn, "/css/red.css")
|
||||||
|
|
||||||
def stylesheet_path(conn, _user),
|
def stylesheet_path(conn, _user),
|
||||||
do: Routes.static_path(conn, "/assets/css/default.css")
|
do: Routes.static_path(conn, "/css/default.css")
|
||||||
|
|
||||||
def dark_stylesheet_path(conn),
|
def dark_stylesheet_path(conn),
|
||||||
do: Routes.static_path(conn, "/assets/css/dark.css")
|
do: Routes.static_path(conn, "/css/dark.css")
|
||||||
|
|
||||||
def theme_name(%{theme: theme}), do: theme
|
def theme_name(%{theme: theme}), do: theme
|
||||||
def theme_name(_user), do: "default"
|
def theme_name(_user), do: "default"
|
||||||
|
|
|
@ -6,10 +6,10 @@ defmodule PhilomenaWeb.SettingView do
|
||||||
[
|
[
|
||||||
key: "Default",
|
key: "Default",
|
||||||
value: "default",
|
value: "default",
|
||||||
data: [theme_path: Routes.static_path(conn, "/assets/css/default.css")]
|
data: [theme_path: Routes.static_path(conn, "/css/default.css")]
|
||||||
],
|
],
|
||||||
[key: "Dark", value: "dark", data: [theme_path: Routes.static_path(conn, "/assets/css/dark.css")]],
|
[key: "Dark", value: "dark", data: [theme_path: Routes.static_path(conn, "/css/dark.css")]],
|
||||||
[key: "Red", value: "red", data: [theme_path: Routes.static_path(conn, "/assets/css/red.css")]]
|
[key: "Red", value: "red", data: [theme_path: Routes.static_path(conn, "/css/red.css")]]
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue