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