Improve markdown support and tweak sponsorship langage

This commit is contained in:
Michael Ball 2020-01-05 15:43:11 -08:00
parent 4c28ecf254
commit 2e817d8739
3 changed files with 10 additions and 4 deletions

View file

@ -1,4 +1,5 @@
# frozen_string_literal: true
require 'redcarpet/render_strip'
module FormatHelper
##
@ -206,6 +207,11 @@ module FormatHelper
markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text", false)
end
# Return a plain text markdown stripped of formatting.
def plain_text(content)
Redcarpet::Markdown.new(Redcarpet::Render::StripDown).render(content)
end
def quantity_left_of(resource)
return '-/-' if resource.quantity.blank?

View file

@ -27,9 +27,9 @@
.row
.col-md-12
%h3.text-center
Want to sponsor?
= "Interested in sponsoring #{conference.title}?"
= link_to(sponsorship_mailto(conference)) do
Contact us!
Please, contact us!
- sponsors.each do |sponsor|
- content_for :modals do

View file

@ -1,10 +1,10 @@
- content_for :head do
%meta{ property: "og:title", content: @conference.title }
%meta{ property: "og:site_name", content: (ENV['OSEM_NAME'] || 'OSEM') }
%meta{ property: "og:description", content: @conference.description }
%meta{ property: "og:description", content: plain_text(@conference.description) }
%meta{ property: "og:url", content: conference_url(@conference.short_title) }
%meta{ property: "twitter:title", content: (@conference.title) }
%meta{ property: "twitter:description", content: @conference.description }
%meta{ property: "twitter:description", content: plain_text(@conference.description) }
- if @conference.picture?
%meta{ property: "og:image", content: @image_url }
%meta{ property: "og:image:secure_url", content: @image_url }