2021-03-23 01:30:14 -07:00
|
|
|
import { url as instanceUrl } from '@client/config';
|
2020-01-29 11:37:25 -08:00
|
|
|
import * as url from '../../prelude/url';
|
2019-02-04 10:51:54 -08:00
|
|
|
|
2019-02-13 06:45:35 -08:00
|
|
|
export function getStaticImageUrl(baseUrl: string): string {
|
|
|
|
const u = new URL(baseUrl);
|
2019-02-04 10:51:54 -08:00
|
|
|
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
|
2019-02-13 06:45:35 -08:00
|
|
|
return `${instanceUrl}/proxy/${dummy}?${url.query({
|
|
|
|
url: u.href,
|
|
|
|
static: '1'
|
|
|
|
})}`;
|
2019-02-04 10:51:54 -08:00
|
|
|
}
|