mirror of https://gitlab.com/curben/blog
fix(image-embed): handle embedding external image
- move to site script to make theme more generic
This commit is contained in:
parent
397eadae2a
commit
81e08296fa
|
@ -21,6 +21,9 @@ hexo.extend.filter.register('marked:renderer', (renderer) => {
|
|||
// See source/_redirects
|
||||
const link = '/img/'
|
||||
|
||||
// embed external image
|
||||
if (!href.startsWith('20')) return `<img src="${href}" alt="${alt}" title="${title}">`
|
||||
|
||||
if (href.endsWith('.png') || href.endsWith('.jpg')) {
|
||||
modern = href.concat('?format=webp')
|
||||
} else if (href.endsWith('.webp')) {
|
Loading…
Reference in New Issue