Optimize template images + disable image optim docker (#313)

* Optimize template images + disable image optim docker

* Fix new name default docker env variable name

* Re-establish template page cache
This commit is contained in:
Julien Nahum
2024-02-06 19:56:14 +01:00
committed by GitHub
parent 2274bd1abd
commit cf32ba22f7
8 changed files with 41 additions and 9 deletions

View File

@@ -0,0 +1,21 @@
import { joinURL } from 'ufo'
import { createOperationsGenerator } from '#image'
const operationsGenerator = createOperationsGenerator()
export const getImage = (
src,
{ modifiers = {}, baseURL } = {}
) => {
if (!baseURL) {
// also support runtime config
baseURL = useRuntimeConfig().public.siteUrl
}
const operations = operationsGenerator(modifiers)
return {
url: joinURL(baseURL, src + (operations ? '?' + operations : '')),
}
}