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