From 5c131b2cd0173634aa2d60547f27938629b429af Mon Sep 17 00:00:00 2001 From: Tunghsiao Liu Date: Tue, 29 Nov 2016 01:04:31 +0800 Subject: [PATCH] feat(amsf): a simpler and more reliable way to get first image --- _app/_includes/_amsf.html | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/_app/_includes/_amsf.html b/_app/_includes/_amsf.html index 0ae2b4525..92d3ebedd 100644 --- a/_app/_includes/_amsf.html +++ b/_app/_includes/_amsf.html @@ -199,16 +199,13 @@ {% comment %} Page thumbnail + TODO: https://regex101.com/r/N2hoxV/1 {% endcomment %} {% capture amsf_post_first_image %} - {% assign post_images = page.content | split: "" | first | match_regex: 'src="([^"]+)"' %} - {% break %} - {% endif %} - {% endfor %} + {% assign hero_image = page.content | match_regex: '