Skip to content

Commit 388a9a8

Browse files
committed
Fetch post and page banners from cloudinary
1 parent 2068706 commit 388a9a8

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

app/templates/components/page-view.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</div>
1212
{{#if page.bannerUrl}}
1313
<div class="banner"
14-
style="background-image: url('{{page.bannerUrl}}')"
14+
style="background-image: url('{{cloudinary-fetch url=page.bannerUrl width=1920}}')"
1515
data-auto-id="page-view-banner">
1616
</div>
1717
{{/if}}

app/templates/components/post-view.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</div>
1212
{{#if post.bannerUrl}}
1313
<div class="banner"
14-
style="background-image: url('{{post.bannerUrl}}')"
15-
data-auto-id="post-view-banner">
14+
style="background-image: url('{{cloudinary-fetch url=post.bannerUrl width=1920}}')"
15+
data-auto-id="post-view-banner">
1616
</div>
1717
{{/if}}
1818
<div class="content" data-auto-id="content">

tests/pages/components/page-view.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,8 @@ function imageUrl(elementSelector) {
2323
css("background-image").
2424
replace(/['"]+/g, '');
2525

26-
return backgroundImageStyle.substring(4, backgroundImageStyle.length - 1);
26+
const cloudinaryUrl = backgroundImageStyle.substring(4, backgroundImageStyle.length - 1);
27+
28+
debugger;
29+
return cloudinaryUrl.replace("https://res.cloudinary.com/cloudinary-test/image/fetch/w_1920/", "");
2730
}

tests/pages/components/post-view.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ function imageUrl(elementSelector) {
2323
css("background-image").
2424
replace(/['"]+/g, '');
2525

26-
return backgroundImageStyle.substring(4, backgroundImageStyle.length - 1);
26+
const cloudinaryUrl = backgroundImageStyle.substring(4, backgroundImageStyle.length - 1);
27+
28+
return cloudinaryUrl.replace("https://res.cloudinary.com/cloudinary-test/image/fetch/w_1920/", "");
2729
}

0 commit comments

Comments
 (0)