Skip to content

Commit

Permalink
Merge pull request #23 from chonla/main
Browse files Browse the repository at this point in the history
feat: Add preview image to show page
  • Loading branch information
chonla authored Oct 25, 2024
2 parents c814d0a + b0f9c2e commit 30597d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cdmm/app/controllers/cdmm_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ def load_form_value(cell, form_data)
end

def evaluation_table(form_data = nil, form_key = nil)
canonical_url = request.env['rack.url_scheme'] + '://' + request.host_with_port + '/cdmm/' + form_key
table = {
:canonical_url => canonical_url,
:preview_image => canonical_url + '/preview',
:form_key => form_key ? form_key : "",
:form_status => :draft,
:title => form_data[:title],
Expand Down
14 changes: 12 additions & 2 deletions cdmm/app/views/cdmm/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
set_meta_tags(
title: @table[:title],
description: @table[:title],
url: @table[:canonical_url],
image_src: @table[:preview_image],
og: {
title: @table[:title],
description: @table[:title]
}
description: @table[:title],
url: @table[:canonical_url],
image: @table[:preview_image],
},
twitter: {
title: @table[:title],
description: @table[:title],
url: @table[:canonical_url],
image: @table[:preview_image],
},
)
%>

Expand Down

0 comments on commit 30597d6

Please sign in to comment.