empress-blog
Version:
Fully-functional, SEO friendly static site implementation of a blog system built on Ember.
35 lines (29 loc) • 823 B
JavaScript
/* eslint-disable prettier/prettier */
import Model, { attr, hasMany } from '@ember-data/model';
import { deprecate } from '@ember/debug';
export default class ContentModel extends Model {
title;
canonical;
content;
excerpt;
html;
image;
imageMeta;
featured;
status;
date;
meta;
_primaryTagId;
tags;
authors;
get primaryTag() {
return this.tags.findBy('id', this._primaryTagId);
}
get author () {
deprecate(`"author" is deprecated in the content model. You must use "authors" now in your templates.`, false, {
id: 'empress-blog:content-model-author',
until: '4.0.0',
});
return this.authors.firstObject;
}
}