Skip to content

Commit

Permalink
🔍️ Add sitename and content metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 5, 2023
1 parent 8ad5d6a commit c730b4c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
26 changes: 23 additions & 3 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const {
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'Writing NFT - Decentralized Publishing - LikeCoin',
title: 'LikeCoin Creator Portal - LikeCoin',
meta: [
{ charset: 'utf-8' },
{ hid: 'viewport', name: 'viewport', content: 'width=device-width' },
{ hid: 'description', name: 'description', content: siteDefaultDescription },
{ hid: 'theme-color', name: 'theme-color', content: '#28646e' },
{ hid: 'og:site_name', property: 'og:site_name', content: 'Writing NFT - Decentralized Publishing - LikeCoin'},
{ hid: 'og:title', property: 'og:title', content: 'Writing NFT - Decentralized Publishing - LikeCoin' },
{ hid: 'og:site_name', property: 'og:site_name', content: 'LikeCoin Creator Portal - LikeCoin'},
{ hid: 'og:title', property: 'og:title', content: 'LikeCoin Creator Portal - LikeCoin' },
{ hid: 'og:image', property: 'og:image', content: 'https://app.like.co/images/og/default.png' },
{ hid: 'og:description', property: 'og:description', content: siteDefaultDescription },
{ hid: 'og:image_alt', property: 'og:image:alt', content: '#DePub' },
Expand All @@ -36,6 +36,26 @@ export default {
{ rel: 'preload', href: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=PT+Mono&display=swap', as: 'style' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=PT+Mono&display=swap' },
],
script: [{
hid: 'schema',
innerHTML: JSON.stringify([
{
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'LikeCoin Creator Portal',
url: 'https://app.like.co/',
},
{
'@context': 'http://www.schema.org',
'@type': 'Project',
name: 'LikeCoin',
url: 'https://like.co',
logo: 'https://like.co/logo.png',
},
]),
type: 'application/ld+json',
}],
__dangerouslyDisableSanitizersByTagID: { schema: ['innerHTML'] },
},

env: {
Expand Down
22 changes: 22 additions & 0 deletions pages/view/_iscnId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ import {
ISCN_TX_RAW_DATA_ENDPOINTS,
WALLET_TYPE_REPLACER,
IPFS_VIEW_GATEWAY_URL,
LIKER_LAND_URL,
} from '~/constant'
import { logTrackerEvent } from '~/utils/logger'
import { ellipsis } from '~/utils/ui'
Expand Down Expand Up @@ -525,6 +526,19 @@ export enum ExifList {
}
const description =
(this as ViewIscnIdPage).metadata?.description || this.$t('page.iscnId.default.description')
const iscnOwner = (this as ViewIscnIdPage).owner;
const iscnOwnerPerson =iscnOwner
? {
'@context': 'http://www.schema.org',
'@type': 'Person',
url: `${LIKER_LAND_URL}/${iscnOwner}`,
identifier: iscnOwner,
}
: undefined;
const schema = {
...(this as ViewIscnIdPage).metadata,
author: iscnOwnerPerson,
};
return {
title,
meta: [
Expand All @@ -544,6 +558,14 @@ export enum ExifList {
content: description,
},
],
script: schema ? [
{
hid: 'schema',
innerHTML: JSON.stringify(schema),
type: 'application/ld+json',
body: true,
},
] : undefined,
} as MetaInfo
},
filters: { ellipsis },
Expand Down

0 comments on commit c730b4c

Please sign in to comment.