mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
#99 host blog entries - images
This commit is contained in:
parent
94dd1efbd5
commit
21aeb610a4
@ -13,10 +13,12 @@
|
|||||||
try {
|
try {
|
||||||
const content = (await import(`../locale/pl/blog/${route.params.slug}.md`)).default;
|
const content = (await import(`../locale/pl/blog/${route.params.slug}.md`)).default;
|
||||||
const title = content.match('<h1[^>]*>([^<]+)</h1>')[1];
|
const title = content.match('<h1[^>]*>([^<]+)</h1>')[1];
|
||||||
|
const img = content.match('<img src="([^"]+)"[^>]*>')[1];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content,
|
content,
|
||||||
title,
|
title,
|
||||||
|
img,
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
return {};
|
return {};
|
||||||
@ -25,6 +27,7 @@
|
|||||||
head() {
|
head() {
|
||||||
return head({
|
return head({
|
||||||
title: this.title,
|
title: this.title,
|
||||||
|
banner: this.img,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -34,7 +34,7 @@ export const head = ({title, description, banner}) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (banner) {
|
if (banner) {
|
||||||
banner = process.env.BASE_URL + '/' + banner;
|
banner = process.env.BASE_URL + '/' + banner.replace(/^\//, '');
|
||||||
meta.meta.push({ hid: 'og:logo', property: 'og:logo', content: banner });
|
meta.meta.push({ hid: 'og:logo', property: 'og:logo', content: banner });
|
||||||
meta.meta.push({ hid: 'twitter:image', property: 'twitter:image', content: banner });
|
meta.meta.push({ hid: 'twitter:image', property: 'twitter:image', content: banner });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user