website backgrounds: make it easy to force a bg for a service
rework a bit the backgrounds transformation script so that we can later easily force a specific background for a specific service. This comes from a request from france-transfert but they changed their mind in the end. Felt like the logic is good to keep for later though.
This commit is contained in:
@@ -23,8 +23,9 @@ async function resizeSourceBackgrounds() {
|
||||
const backgrounds = await readdir(sourcesDir)
|
||||
backgrounds.forEach((backgroundFile, i) => {
|
||||
const srcPath = path.join(sourcesDir, backgroundFile)
|
||||
const jpegPath = path.join(outputDir, `${i}.jpg`)
|
||||
const avifPath = path.join(outputDir, `${i}.avif`)
|
||||
const backgroundName = path.parse(backgroundFile).name
|
||||
const jpegPath = path.join(outputDir, `${backgroundName}.jpg`)
|
||||
const avifPath = path.join(outputDir, `${backgroundName}.avif`)
|
||||
|
||||
const image = sharp(srcPath)
|
||||
.resize(1920, 1200, { fit: "cover" })
|
||||
|
||||
Reference in New Issue
Block a user