Editable content #229

Merged
greg merged 15 commits from feature/186-content_editing into master 2025-05-30 11:14:51 +00:00
3 changed files with 12 additions and 0 deletions
Showing only changes of commit 315cf4dd9f - Show all commits

View File

@ -42,6 +42,7 @@ gem 'flipper-active_record'
gem 'flipper-ui'
gem 'gpgme', '~> 2.0.24'
gem 'zbase32', '~> 0.1.1'
gem 'kramdown'
# HTTP requests
gem 'faraday'

View File

@ -549,6 +549,7 @@ DEPENDENCIES
image_processing (~> 1.12.2)
importmap-rails
jbuilder (~> 2.7)
kramdown
letter_opener
letter_opener_web
listen (~> 3.2)

View File

@ -0,0 +1,10 @@
module EditableContentHelper
def editable_content_for(path, key, default: nil, create_rich: false)
@content = EditableContent.find_by(path: "contributions/other", key: key)
@content.content.present? ? @content.content : default
end
def markdown_to_html(string)
raw Kramdown::Document.new(string, { input: "GFM" }).to_html
end
end