-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show
mediaTypes.native.image.sizes
in examples
In addition to updating the basic examples to use sizes for images and icons, we add a section to both the API reference and the 'Show Native Ads' page that lists both ways to define sizes for image-like assets. Since the content is the same, it's in a shared file sourced using the Liquid `include` keyword.
- Loading branch information
Rich Loveland
committed
Jan 17, 2018
1 parent
9c977b1
commit 635016e
Showing
3 changed files
with
43 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
There are two methods for defining sizes for image-like assets (`image` and `icon`). Both are shown below, but the first example (using `sizes`) is more widely supported by demand partners. | ||
|
||
1. Using `mediaTypes.native.image.sizes` (or `mediaTypes.native.icon.sizes` for icons): | ||
|
||
```javascript | ||
mediaTypes: { | ||
native: { | ||
image: { | ||
required: true, | ||
sizes: [150, 50] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
2. Using `mediaTypes.native.image.aspect_ratios` (or `mediaTypes.native.icon.aspect_ratios` for icons): | ||
|
||
```javascript | ||
mediaTypes: { | ||
native: { | ||
image: { | ||
required: true, | ||
aspect_ratios: [{ | ||
min_width: 300, /* Optional */ | ||
ratio_width: 2, /* Required */ | ||
ratio_height: 3, /* Required */ | ||
}] | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters