From b7c5853de5f0f04625eab6389cba9de8b02e48fb Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 12 May 2025 14:53:31 -0400 Subject: Added streams index --- app/controllers/blogs_controller.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'app/controllers/blogs_controller.rb') diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index 4f6d9ce..6e80754 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb @@ -1,12 +1,7 @@ -require 'redcarpet/render_strip' -class StrippedSummary < Redcarpet::Render::StripDown - def block_html(raw_html) - nil - end -end class BlogsController < ApplicationController + include ApplicationHelper def summary @blogs = Blog.where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10) @@ -33,12 +28,12 @@ class BlogsController < ApplicationController @prev = @blog.prev @next = @blog.next - body = Redcarpet::Markdown.new(StrippedSummary).render(@blog.body) + body = stripped_markdown(@blog.body) set_meta_tags(og: { title: @blog.title, type: "article", - description: (body.length <= 300 ? body : body[0..299]), + description: body[0, 299], url: blog_url(@blog, host: "www.fourisland.com"), article: { published_time: @blog.published_at.iso8601, -- cgit 1.4.1