Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Company posts metas (#64)
Browse files Browse the repository at this point in the history
* added meta infos to 'firmalar' page

* length control

* removed home meta

* mixin up to components

* removed unnecessary notfound
  • Loading branch information
faranjit authored and fatihacet committed Jan 20, 2020
1 parent 053d705 commit d4c9c49
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/pages/CompanyPosts.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<script>
import { mapActions } from 'vuex';
import image from '../../mixins/image';
import JobListing from '../shared/JobListing';
import companyPostsMetaInfoMixin from '../../mixins/companyPostsMetaInfo';
export default {
name: 'CompanyPosts',
mixins: [companyPostsMetaInfoMixin, image],
components: {
JobListing,
},
data() {
return {
posts: [],
isLoading: false,
isLoading: true,
};
},
methods: {
Expand Down
47 changes: 47 additions & 0 deletions src/mixins/companyPostsMetaInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export default {
metaInfo() {
if (this.isLoading || this.posts.length === 0) {
return {};
}

const { company } = this.posts[0];
const companyName = company.name;
const defaultKeywords = ['iş ilanları, yazılım iş ilanları, bilişim iş ilanları'];
const description = `${companyName} firması takım arkadaşları arıyor`;
const ogTitle = `${companyName} iş ilanları`;

const keywords = this.posts[0].tags.map(tag => tag.name)
.concat(defaultKeywords)
.join(', ');

return {
title: `${companyName} firmasına ait ilanlar`,
meta: [
{
name: 'description',
content: description,
},
{
name: 'keywords',
content: keywords,
},
{
name: 'og:image',
content: company.logo,
},
{
name: 'og:description',
content: description,
},
{
name: 'og:title',
content: ogTitle,
},
{
name: 'og:url',
content: this.posts[0].post_url,
},
],
};
},
};

0 comments on commit d4c9c49

Please sign in to comment.