mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 14:32:04 -04:00
[blog] finding hero image in ANY paragraph
This commit is contained in:
parent
97195eddc3
commit
e2109bf940
@ -41,7 +41,10 @@ router.get('/blog', handleErrorAsync(async (req, res) => {
|
||||
}
|
||||
|
||||
try {
|
||||
hero = content[2].match(/^!\[[^\]]*]\(([^)]+)\)$/)[1];
|
||||
const images = content.map(x => x.match(/^!\[[^\]]*]\(([^)]+)\)$/)).filter(x => !!x);
|
||||
if (images.length) {
|
||||
hero = images[0][1];
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user