mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
✨ Added feature_image_{alt/caption}
to the v4 posts API
refs https://github.com/TryGhost/Team/issues/839 It's now possible to set alt and caption for post feature images using `feature_image_alt` and `feature_image_caption` fields on a post resource. - `feature_image_alt` - plain text, limited to 191 chars (alt text is not recommended to be longer than 125 chars, screen readers may cut the description off at that point) - `feature_image_caption` - basic HTML, limited to 65535 chars Alt and caption will be automatically used inside of newsletter content, for your website content make sure your theme is updated to use the v4 API and make use of the new properties. --- - removed `featureImageMeta` labs flag
This commit is contained in:
parent
884f39d045
commit
517d2abc5c
6 changed files with 2 additions and 25 deletions
|
@ -103,13 +103,6 @@ const forceStatusFilter = (frame) => {
|
|||
}
|
||||
};
|
||||
|
||||
const cleanLabsProperties = (frame) => {
|
||||
if (!labs.isSet('featureImageMeta') && frame.data.pages[0]) {
|
||||
delete frame.data.pages[0].feature_image_alt;
|
||||
delete frame.data.pages[0].feature_image_caption;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
browse(apiConfig, frame) {
|
||||
debug('browse');
|
||||
|
@ -188,7 +181,6 @@ module.exports = {
|
|||
});
|
||||
}
|
||||
|
||||
cleanLabsProperties(frame);
|
||||
handlePostsMeta(frame);
|
||||
defaultFormat(frame);
|
||||
defaultRelations(frame);
|
||||
|
|
|
@ -112,13 +112,6 @@ const transformLegacyEmailRecipientFilters = (frame) => {
|
|||
}
|
||||
};
|
||||
|
||||
const cleanLabsProperties = (frame) => {
|
||||
if (!labs.isSet('featureImageMeta') && frame.data.posts[0]) {
|
||||
delete frame.data.posts[0].feature_image_alt;
|
||||
delete frame.data.posts[0].feature_image_caption;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
browse(apiConfig, frame) {
|
||||
debug('browse');
|
||||
|
@ -213,7 +206,6 @@ module.exports = {
|
|||
});
|
||||
}
|
||||
|
||||
cleanLabsProperties(frame);
|
||||
transformLegacyEmailRecipientFilters(frame);
|
||||
handlePostsMeta(frame);
|
||||
defaultFormat(frame);
|
||||
|
|
|
@ -125,11 +125,6 @@ const post = (attrs, frame) => {
|
|||
delete attrs.author;
|
||||
delete attrs.type;
|
||||
|
||||
if (!labs.isSet('featureImageMeta')) {
|
||||
delete attrs.feature_image_alt;
|
||||
delete attrs.feature_image_caption;
|
||||
}
|
||||
|
||||
return attrs;
|
||||
};
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ const BETA_FEATURES = [
|
|||
|
||||
const ALPHA_FEATURES = [
|
||||
'multipleProducts',
|
||||
'featureImageMeta',
|
||||
'psmRedesign'
|
||||
];
|
||||
|
||||
|
|
|
@ -141,8 +141,7 @@ const getTemplateSettings = async () => {
|
|||
bodyFontCategory: settingsCache.get('newsletter_body_font_category'),
|
||||
showBadge: settingsCache.get('newsletter_show_badge'),
|
||||
footerContent: settingsCache.get('newsletter_footer_content'),
|
||||
accentColor: settingsCache.get('accent_color'),
|
||||
labsFeatureImageMeta: labs.isSet('featureImageMeta')
|
||||
accentColor: settingsCache.get('accent_color')
|
||||
};
|
||||
|
||||
if (templateSettings.headerImage) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
const iff = (cond, yes, no) => (cond ? yes : no);
|
||||
module.exports = ({post, site, templateSettings}) => {
|
||||
const date = new Date();
|
||||
const hasFeatureImageCaption = templateSettings.labsFeatureImageMeta && templateSettings.showFeatureImage && post.feature_image && post.feature_image_caption;
|
||||
const hasFeatureImageCaption = templateSettings.showFeatureImage && post.feature_image && post.feature_image_caption;
|
||||
return `<!doctype html>
|
||||
<html>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue