SEO & favicon fixes (#1229)

* fix URLs and title

* solve all favicon things

* image optimizations through ImageOptim

* typing fix
This commit is contained in:
Matthias Kretschmann 2022-03-22 14:57:33 +00:00 committed by GitHub
parent ad09e2c99d
commit 69c3db2caa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 38 additions and 12 deletions

View File

@ -1,9 +1,8 @@
{
"siteTitle": "Ocean Market",
"siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.",
"siteUrl": "https://market.oceanprotocol.com",
"siteIcon": "node_modules/@oceanprotocol/art/logo/favicon-white.png",
"siteImage": "../src/@images/share.png",
"siteUrl": "https://v4.market.oceanprotocol.com",
"siteImage": "/share.png",
"copyright": "All Rights Reserved. Powered by [Ocean Protocol](https://oceanprotocol.com)",
"menu": [
{

2
package-lock.json generated
View File

@ -26715,6 +26715,7 @@
"cross-fetch": "^3.1.5",
"crypto-js": "^4.1.1",
"decimal.js": "^10.3.1",
"web3": "^1.7.1",
"web3-core": "^1.7.1",
"web3-eth-contract": "^1.7.1"
}
@ -26817,6 +26818,7 @@
"integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==",
"dev": true,
"requires": {
"@oclif/config": "^1.15.1",
"@oclif/errors": "^1.3.3",
"@oclif/parser": "^3.8.3",
"@oclif/plugin-help": "^3",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
public/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

1
public/icon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

14
public/site.webmanifest Normal file
View File

@ -0,0 +1,14 @@
{
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@ -2,7 +2,6 @@ export interface UseSiteMetadata {
siteTitle: string
siteTagline: string
siteUrl: string
siteIcon: string
siteImage: string
copyright: string
menu: {

View File

@ -17,24 +17,35 @@ export default function Seo({
// Remove trailing slash from all URLs
const canonical = `${siteUrl}${uri}`.replace(/\/$/, '')
const pageTitle = title
? `${title} - ${siteTitle}`
: `${siteTitle}${siteTagline}`
return (
<Head>
<html lang="en" />
<title>{`${siteTitle}${siteTagline}`}</title>
<title>{pageTitle}</title>
{isBrowser &&
window.location &&
window.location.hostname !== 'oceanprotocol.com' && (
<meta name="robots" content="noindex,nofollow" />
)}
{isBrowser && window?.location?.hostname !== 'oceanprotocol.com' && (
<meta name="robots" content="noindex,nofollow" />
)}
<link rel="canonical" href={canonical} />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link rel="manifest" href="/site.webmanifest" />
<meta name="theme-color" content="var(--background-content)" />
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={uri} />
<meta property="og:url" content={canonical} />
<meta name="image" content={`${siteUrl}${siteImage}`} />
<meta property="og:image" content={`${siteUrl}${siteImage}`} />

View File

@ -8,7 +8,7 @@ export default function PageAssetDetails(): ReactElement {
const { did } = router.query
return (
<AssetProvider did={did as string}>
<PageTemplateAssetDetails uri={router.pathname} />
<PageTemplateAssetDetails uri={router.asPath} />
</AssetProvider>
)
}