twemojiをセルフホストに変更

This commit is contained in:
moris 2025-03-12 23:12:55 +09:00
parent 836073ecb8
commit e7bdc89980

View file

@ -20,8 +20,16 @@ function parser(fm_text:string) {
let index = 'index' in fm && typeof fm.index === 'boolean' ? fm.index : true let index = 'index' in fm && typeof fm.index === 'boolean' ? fm.index : true
let published = 'published' in fm && typeof fm.published === 'boolean' ? fm.published : false let published = 'published' in fm && typeof fm.published === 'boolean' ? fm.published : false
emoji = parse(emoji)[0]?.url ?? '' emoji = parse(emoji, {buildUrl: builder})[0]?.url ?? ''
function builder(codepoints: string, assetType: string): string {
if (assetType == "png") {
return `https://moris.day/twemoji/72x72/${codepoints}.png`
} else {
return `https://moris.day/twemoji/svg/${codepoints}.svg`
}
}
let date:Date = new Date(date_str) let date:Date = new Date(date_str)
return {title, description,thumbnail,emoji,date,category,tags,index,published} return {title, description,thumbnail,emoji,date,category,tags,index,published}