문제

Is there any easy way to keep images from showing up in Middleman blog post summaries?

I have images that appear near the beginning of my post, and therefore appear in the summary. I would like for the summary to only include text.

I see that you can write your own summary generator, but I haven't learned Ruby yet. I'm hoping that this is a built-in option that I haven't come across yet.

도움이 되었습니까?

해결책

Try including gem 'nokogiri' into your Gemfile, running bundle install and starting your Middleman server with bundle exec middleman server.

Then you should be able to do Nokogiri::HTML(article.summary).text to retrieve text from summaries.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top