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

Commit

Permalink
Merge i18n for default description and fix keys
Browse files Browse the repository at this point in the history
  • Loading branch information
zackkrida committed Aug 12, 2021
2 parents 9238bba + c928788 commit e418acb
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 21 deletions.
12 changes: 0 additions & 12 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ export const env = {
*/
const meta = [
{ charset: 'utf-8' },
{
hid: 'description',
name: 'description',
content:
'The search engine for openly-licensed content, including Creative Commons licensed images, audio, and more.',
},
{ name: 'viewport', content: 'width=device-width,initial-scale=1' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:site', content: '@wordpress' },
Expand All @@ -35,12 +29,6 @@ const meta = [
name: 'og:image',
content: '/cclogo-shared-image.jpg',
},
{
hid: 'og:description',
name: 'og:description',
content:
'The search engine for openly-licensed content, including Creative Commons licensed images, audio, and more.',
},
{
name: 'og:url',
content: 'https://creativecommons.org',
Expand Down
19 changes: 18 additions & 1 deletion src/layouts/embedded-with-nav-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,24 @@ const embeddedWithNavSearch = {
name: 'embedded-with-nav-search',
layout: 'embedded-with-nav-search',
head() {
return this.$nuxtI18nHead({ addSeoAttributes: true })
const i18nHead = this.$nuxtI18nHead({ addSeoAttributes: true })
return {
htmlAttrs: { ...i18nHead.htmlAttrs },
link: [...i18nHead.link],
meta: [
{
hid: 'description',
name: 'description',
content: this.$t('seo.descriptions.default'),
},
{
hid: 'og:description',
name: 'og:description',
content: this.$t('seo.descriptions.default'),
},
...i18nHead.meta,
],
}
},
}
export default embeddedWithNavSearch
Expand Down
27 changes: 22 additions & 5 deletions src/layouts/embedded.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,29 @@
</div>
</template>
<script>
const defaultPage = {
name: 'default',
layout: 'default',
const embedded = {
name: 'embedded',
layout: 'embedded',
head() {
return this.$nuxtI18nHead({ addSeoAttributes: true })
const i18nHead = this.$nuxtI18nHead({ addSeoAttributes: true })
return {
htmlAttrs: { ...i18nHead.htmlAttrs },
link: [...i18nHead.link],
meta: [
{
hid: 'description',
name: 'description',
content: this.$t('seo.descriptions.default'),
},
{
hid: 'og:description',
name: 'og:description',
content: this.$t('seo.descriptions.default'),
},
...i18nHead.meta,
],
}
},
}
export default defaultPage
export default embedded
</script>
5 changes: 3 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,14 @@
},
"seo": {
"titles": {
"default": "Openverse: Openly-licensed Images, Audio, & other Content",
"about": "About Openverse: The search engine for openly-licensed images, audio, and more",
"extension": "Download the Openverse Browser Extension: search and use open-licensed and public domain images",
"singlePhoto": "{title} by {creator} | Free Image on Openverse",
"search": "{media} results for \"{query}\" on Openverse",
"home": "Openverse: Openly-licensed Images, Audio, & More"
"search": "{media} results for \"{query}\" on Openverse"
},
"descriptions": {
"default": "The search engine for openly-licensed content, including Creative Commons licensed images, audio, and more.",
"extension": "The Openverse browser extension allows users to search, bookmark, and cite Creative Commons licensed images."
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const HomePage = {
mixins: [iframeHeight],
head() {
return {
title: this.$t('seo.titles.home'),
title: this.$t('seo.titles.default'),
}
},
layout({ store }) {
Expand Down

0 comments on commit e418acb

Please sign in to comment.