Open gonzaloriestra opened 4 years ago
@cmongut we need to define what to add as description and image.
Are we saving a description in kuvizs? About the default image, we are working on it. Could we leave it prepare with a random picture to know it works and change it next week?
The creation endpoint only receives the name, but I'm not sure if we are adding a description tag inside the HTML from CF (the name is already included as the title). @oleurud?
For example, this one has a title and an empty description: https://cartoframes.carto.com/kuviz/933d429c-a844-4c6b-8bc3-0d02e1737dbc
You can add the description using the Map description
parameter
https://team.carto.com/u/simon-carto/kuviz/0a5dd049-b6f1-474b-82cc-2b3abb098e76
Nice description @oleurud!
Let's use that field then :)
One possible approach to include the metadata tags could be to modify the HTML after downloading it from S3. We could do it after calling add_cache_headers
in both show
and show_protected
from kuviz/visualization_controller.rb with something like this:
def add_metadata_tags
doc = Nokogiri::HTML::Document.parse(@source)
head = doc.at('head')
head << "<meta name=\"twitter:title\" content=\"patatin\">"
@source = doc.to_html
end
We would need to add the same tags for Facebook (og
) and Twitter that we use here: https://github.com/CartoDB/cartodb/blob/10b787af6f395c560df8e7be0d388f7bb41389ac/app/views/layouts/application_public_visualization_layout.html.erb
After talking with @VictorVelarde, it seems it would make more sense to add these tags from the client (CARTOframes). So I'm moving this issue to the CF project.
Add a default icon and metatags (title, description, image) to the Kuviz's HTML to improve the sharing experience in social networks