Skip to content

Commit

Permalink
Merge pull request #115 from sharetribe/fix-clp-image-export-urls
Browse files Browse the repository at this point in the history
Fix URL for CLP images when exporting
  • Loading branch information
bladealslayer committed Jan 28, 2022
2 parents 62c6428 + 09658cd commit 27242e9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/tasks/export.rake
Expand Up @@ -11,14 +11,13 @@ namespace :export do

released_version = CustomLandingPage::LandingPageStore.released_version(community_id)
structure = CustomLandingPage::LandingPageStore.load_structure(community_id, released_version)
sitename = structure["settings"]["sitename"]

# Build direct S3 URL, instead of the CDN one, so that image paths maintain
# the sites/SITENAME prefix. This helps the data export script to organize
# the downloaded images correctly.
# the sites/COMMUNITY_ID prefix. This helps the data export script to
# organize the downloaded images correctly.
assets = structure["assets"]
assets.select { |a| a["content_type"].match(/^image\//) }.map do |image|
puts "https://#{APP_CONFIG.clp_s3_bucket_name}.s3.amazonaws.com/sites/#{sitename}/#{image['src']}"
puts "https://#{APP_CONFIG.clp_s3_bucket_name}.s3.amazonaws.com/sites/#{community_id}/#{image['src']}"
end
end

Expand Down

0 comments on commit 27242e9

Please sign in to comment.