mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed post excerpt fallback in Stories list (#1052)
closes https://github.com/TryGhost/Ghost/issues/9775 - update the `subText` CP to prioritise the custom excerpt over meta description and plain text content
This commit is contained in:
parent
8ae47cd0e5
commit
d1427c8ba3
1 changed files with 6 additions and 4 deletions
|
@ -31,15 +31,17 @@ export default Component.extend({
|
||||||
return authors.map(author => author.get('name') || author.get('email')).join(', ');
|
return authors.map(author => author.get('name') || author.get('email')).join(', ');
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// HACK: this is intentionally awful due to time constraints
|
subText: computed('post.{plaintext,customExcerpt,metaDescription}', function () {
|
||||||
// TODO: find a better way to get an excerpt! :)
|
|
||||||
subText: computed('post.{plaintext,metaDescription}', function () {
|
|
||||||
let text = this.get('post.plaintext') || '';
|
let text = this.get('post.plaintext') || '';
|
||||||
|
let customExcerpt = this.get('post.customExcerpt');
|
||||||
let metaDescription = this.get('post.metaDescription');
|
let metaDescription = this.get('post.metaDescription');
|
||||||
|
|
||||||
if (!isBlank(metaDescription)) {
|
if (!isBlank(customExcerpt)) {
|
||||||
|
text = customExcerpt;
|
||||||
|
} else if (!isBlank(metaDescription)) {
|
||||||
text = metaDescription;
|
text = metaDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${text.slice(0, 80)}...`;
|
return `${text.slice(0, 80)}...`;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue