PageSeo.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { Collection, Model } from 'js-abstract-model'
  2. class PageSeo extends Model {
  3. constructor (data) {
  4. super(data, [
  5. {
  6. key: 'title',
  7. default: 'شهید پالیزوانی'
  8. },
  9. {
  10. key: 'description',
  11. default: 'شهید پالیزوانی'
  12. },
  13. { key: 'url' },
  14. { key: 'canonical' },
  15. { key: 'site' },
  16. { key: 'imageUrl' },
  17. { key: 'imageWidth' },
  18. { key: 'imageHeight' },
  19. { key: 'ogTitle' },
  20. { key: 'ogUrl' },
  21. { key: 'ogDescription' },
  22. { key: 'ogImage' }
  23. ])
  24. }
  25. getFormattedStyle () {
  26. return {
  27. title: this.title,
  28. description: this.description,
  29. robots: 'index, follow',
  30. ogTitle: this.title,
  31. ogUrl: this.url ? this.url : (this.ogUrl ? this.ogUrl : ''),
  32. ogDescription: this.description,
  33. ogImage: this.imageUrl ? this.imageUrl : (this.ogImage ? this.ogImage : '')
  34. }
  35. }
  36. }
  37. class PageSeoList extends Collection {
  38. model() {
  39. return PageSeo
  40. }
  41. }
  42. export { PageSeo, PageSeoList }