_alias.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div>
  3. <Article :news="newsItem" />
  4. </div>
  5. </template>
  6. <script>
  7. import { mapGetters } from "vuex";
  8. export default {
  9. data() {
  10. return {
  11. adsList: [],
  12. count: 0
  13. }
  14. },
  15. computed: {
  16. ...mapGetters({
  17. newsItem: "modules/news/newsItem",
  18. }),
  19. status() {
  20. if (!this.ads) {
  21. return false;
  22. } else {
  23. return true;
  24. }
  25. },
  26. },
  27. mounted() {},
  28. async fetch({ store, route, error }) {
  29. await store.dispatch("modules/news/setNewsItem", {
  30. category: 'articles',
  31. alias: route.params.alias
  32. });
  33. const newsItem = store.getters['modules/news/newsItem'];
  34. if(!newsItem){
  35. error({ statusCode: 404 })
  36. }
  37. },
  38. head() {
  39. return {
  40. title: this.newsItem.title,
  41. meta: [
  42. {
  43. name: "copyright",
  44. content: "ИА Амител",
  45. },
  46. {
  47. name: "publisher",
  48. content: "https://g.page/amitel?gm",
  49. },
  50. {
  51. name: "author",
  52. content: this.newsItem.show_author ? this.newsItem.author ? this.newsItem.author.name : 'ИА Амител' : "ИА Амител",
  53. },
  54. {
  55. name: "mediator_author",
  56. content: "ИА Амител",
  57. },
  58. {
  59. name: "description",
  60. content: this.newsItem.description
  61. },
  62. {
  63. name: "keys",
  64. content:
  65. this.newsItem.meta.key
  66. },
  67. {
  68. hid: 'twitter:title',
  69. name: 'twitter:title',
  70. content: this.newsItem.title
  71. },
  72. {
  73. hid: 'twitter:description',
  74. name: 'twitter:description',
  75. content: this.newsItem.description
  76. },
  77. // {
  78. // hid: 'twitter:image',
  79. // name: 'twitter:image',
  80. // content: this.newsItem.image.url
  81. // },
  82. {
  83. hid: 'twitter:image:alt',
  84. name: 'twitter:image:alt',
  85. content: this.newsItem.title
  86. },
  87. {
  88. hid: 'og:title',
  89. property: 'og:title',
  90. content: this.newsItem.title
  91. },
  92. {
  93. hid: 'og:description',
  94. property: 'og:description',
  95. content: this.newsItem.description
  96. },
  97. // {
  98. // hid: 'og:image',
  99. // property: 'og:image',
  100. // content: this.newsItem.image.url
  101. // },
  102. // {
  103. // hid: 'og:image:secure_url',
  104. // property: 'og:image:secure_url',
  105. // content: this.newsItem.image.url
  106. // },
  107. {
  108. hid: 'og:image:alt',
  109. property: 'og:image:alt',
  110. content: this.newsItem.title
  111. }
  112. ],
  113. link_id: [
  114. {rel: 'canonical', href: this.newsItem.category ? 'https://www.amic.ru/articles/' + this.newsItem.alias : ''}
  115. ],
  116. };
  117. },
  118. };
  119. </script>
  120. <style lang="less">
  121. .detail-top__header {
  122. margin-bottom: 0;
  123. }
  124. @media screen and (max-width: 900px) {
  125. .detail {
  126. &__wrapper {
  127. flex-direction: column-reverse;
  128. }
  129. &__side {
  130. margin-bottom: 20px;
  131. display: none;
  132. }
  133. }
  134. .detail-top {
  135. &__header {
  136. display: block;
  137. }
  138. &__footer {
  139. display: block;
  140. }
  141. &__footer-side {
  142. display: flex;
  143. margin-top: 20px;
  144. }
  145. }
  146. .detail-article-news__wrapper {
  147. display: block;
  148. }
  149. }
  150. .detail-article-news__side {
  151. display: flex;
  152. align-items: center;
  153. }
  154. </style>