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

Commit

Permalink
Merge pull request #208 from yannglt/develop
Browse files Browse the repository at this point in the history
Add dynamic og images for notes
  • Loading branch information
yannglt committed Oct 23, 2022
2 parents bd46b86 + 7d3f90b commit 517cbfb
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 33 deletions.
26 changes: 3 additions & 23 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,21 @@ export default {
content: 'Personal space of Yann-Edern Gillet, a designer thinking, creating and breaking interfaces, products and systems with a focus on design operations'
},
{
name: 'og:title',
content: 'Yann-Edern Gillet, Product Designer',
},
{
name: 'og:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
name: 'og:url',
content: 'https://yannglt.com',
name: 'og:description',
content: 'Personal space of Yann-Edern Gillet, a designer thinking, creating and breaking interfaces, products and systems with a focus on design operations',
},
{
name: 'og:description',
name: 'twitter:description',
content: 'Personal space of Yann-Edern Gillet, a designer thinking, creating and breaking interfaces, products and systems with a focus on design operations',
},
{
name: 'twitter:site',
content: '@yannglt',
},
{
name: 'twitter:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
name: 'twitter:card',
content: 'summary_large_image',
},
{
name: 'twitter:title',
content: 'Yann-Edern Gillet, Product Designer',
},
{
name: 'twitter:description',
content: 'Personal space of Yann-Edern Gillet, a designer thinking, creating and breaking interfaces, products and systems with a focus on design operations',
},
],
script: [
{ src: 'https://unpkg.com/splitting/dist/splitting.min.js' }
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"@nuxtjs/axios": "^5.13.1",
"nuxt": "^2.15.2",
"vue-server-renderer": "^2.6.11",
"vue-gtag": "1.16.1"
"vue-gtag": "1.16.1",
"vue-server-renderer": "^2.6.11"
},
"devDependencies": {
"@nuxtjs/markdownit": "^2.0.0",
Expand All @@ -27,10 +27,10 @@
"gsap": "^3.6.1",
"imports-loader": "^1.2.0",
"moment": "^2.29.1",
"sass": "^1.39.2",
"nodemon": "^2.0.7",
"sass": "^1.39.2",
"sass-loader": "^10.0.3",
"vee-validate": "^3.4.5",
"vue-clipboard2": "^0.3.1"
}
}
}
33 changes: 33 additions & 0 deletions pages/about/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,39 @@
}
},
head() {
return {
title: 'Yann-Edern Gillet — About',
meta: [
{
hid: 'og:title',
name: 'og:title',
content: 'Yann-Edern Gillet — About',
},
{
hid: 'twitter:title',
name: 'twitter:title',
content: 'Yann-Edern Gillet — About',
},
{
hid: 'og:image',
name: 'og:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'og:url',
name: 'og:url',
content: 'https://yannglt.com/about/',
},
]
}
},
methods: {
collapseAllFacts: function() {
this.$refs.fact.forEach((fact) => {
Expand Down
33 changes: 33 additions & 0 deletions pages/about/moodboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,39 @@
}
},
head() {
return {
title: 'Yann-Edern Gillet — Moodboard',
meta: [
{
hid: 'og:title',
name: 'og:title',
content: 'Yann-Edern Gillet — Moodboard',
},
{
hid: 'twitter:title',
name: 'twitter:title',
content: 'Yann-Edern Gillet — Moodboard',
},
{
hid: 'og:image',
name: 'og:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'og:url',
name: 'og:url',
content: 'https://yannglt.com/moodboard/',
},
]
}
},
methods: {
importAll(r) {
r.keys().forEach(key => (this.inspirationsImages.push({ pathLong: r(key) })))
Expand Down
33 changes: 33 additions & 0 deletions pages/contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,39 @@
}
},
head() {
return {
title: 'Yann-Edern Gillet — Contact',
meta: [
{
hid: 'og:title',
name: 'og:title',
content: 'Yann-Edern Gillet — Contact',
},
{
hid: 'twitter:title',
name: 'twitter:title',
content: 'Yann-Edern Gillet — Contact',
},
{
hid: 'og:image',
name: 'og:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'og:url',
name: 'og:url',
content: 'https://yannglt.com/contact/',
},
]
}
},
methods: {
copyEmail: function () {
this.$copyText(this.email)
Expand Down
33 changes: 33 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,39 @@
}
},
head() {
return {
title: 'Yann-Edern Gillet',
meta: [
{
hid: 'og:title',
name: 'og:title',
content: 'Yann-Edern Gillet',
},
{
hid: 'twitter:title',
name: 'twitter:title',
content: 'Yann-Edern Gillet',
},
{
hid: 'og:image',
name: 'og:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'og:url',
name: 'og:url',
content: 'https://yannglt.com/',
},
]
}
},
methods: {
copyEmail: function () {
this.$copyText(this.email)
Expand Down
36 changes: 32 additions & 4 deletions pages/notes/_slug.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,43 @@
import SuperLink from '@/components/SuperLink.vue'
export default {
head() {
data() {
return {
title: this.note.fields.title
slug: this.$route.params.slug
}
},
data() {
head() {
return {
slug: this.$route.params.slug
title: this.note.fields.title,
meta: [
{
hid: 'og:title',
name: 'og:title',
content: this.note.fields.title,
},
{
hid: 'twitter:title',
name: 'twitter:title',
content: this.note.fields.title,
},
{
hid: 'og:image',
name: 'og:image',
content: 'https://dynamic-og-image-helloyannglt.vercel.app/api/og?title=' + this.note.fields.title,
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: 'https://dynamic-og-image-helloyannglt.vercel.app/api/og?title=' + this.note.fields.title,
},
{
hid: 'og:url',
name: 'og:url',
content: 'https://yannglt.com/notes/' + this.note.fields.slug,
},
]
}
},
Expand Down
33 changes: 31 additions & 2 deletions pages/notes/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,37 @@
export default {
data: function () {
return { }
head() {
return {
title: 'Yann-Edern Gillet — Notes',
meta: [
{
hid: 'og:title',
name: 'og:title',
content: 'Yann-Edern Gillet — Notes',
},
{
hid: 'twitter:title',
name: 'twitter:title',
content: 'Yann-Edern Gillet — Notes',
},
{
hid: 'og:image',
name: 'og:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: 'https://yannglt.com/images/og-image.png',
},
{
hid: 'og:url',
name: 'og:url',
content: 'https://yannglt.com/notes/',
},
]
}
},
computed: {
Expand Down

0 comments on commit 517cbfb

Please sign in to comment.