1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 07:52:43 +00:00

fix: build pictures at correct location and fix Plug.Static

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2023-11-15 18:15:21 +01:00
parent f24866012b
commit 3c288c5858
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
3 changed files with 16 additions and 17 deletions

View file

@ -10,6 +10,21 @@ defmodule Mobilizon.Web.Endpoint do
use Phoenix.Endpoint, otp_app: :mobilizon use Phoenix.Endpoint, otp_app: :mobilizon
use Absinthe.Phoenix.Endpoint use Absinthe.Phoenix.Endpoint
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phoenix.digest
# when deploying your static files in production.
plug(
Plug.Static,
at: "/",
from: {:mobilizon, "priv/static"},
gzip: false,
only: Mobilizon.Web.static_paths()
# only_matching: ["precache-manifest"]
)
plug(Mobilizon.Web.Plugs.UploadedMedia)
plug(Mobilizon.Web.Plugs.DetectLocalePlug) plug(Mobilizon.Web.Plugs.DetectLocalePlug)
if Application.compile_env(:mobilizon, :env) !== :dev do if Application.compile_env(:mobilizon, :env) !== :dev do
@ -37,21 +52,6 @@ defmodule Mobilizon.Web.Endpoint do
do: RemoteIp do: RemoteIp
) )
plug(Mobilizon.Web.Plugs.UploadedMedia)
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phoenix.digest
# when deploying your static files in production.
plug(
Plug.Static,
at: "/",
from: {:mobilizon, "priv/static"},
gzip: false,
only: Mobilizon.Web.static_paths(),
only_matching: ["precache-manifest"]
)
# Code reloading can be explicitly enabled under the # Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint. # :code_reloader configuration of your endpoint.
if code_reloading? do if code_reloading? do

View file

@ -72,7 +72,6 @@ defmodule Mobilizon.Web.Router do
pipeline :browser do pipeline :browser do
plug(:put_request_context) plug(:put_request_context)
plug(Plug.Static, at: "/", from: "priv/static")
plug(Mobilizon.Web.Plugs.SetLocalePlug) plug(Mobilizon.Web.Plugs.SetLocalePlug)

View file

@ -2,7 +2,7 @@
set -eu set -eu
output_dir="../priv/static/img/pics" output_dir="priv/static/img/pics"
resolutions=( resolutions=(
480 480
1024 1024