-
Notifications
You must be signed in to change notification settings - Fork 0
Improve PortalJS template's SEO features #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Datopian-Shreyas
merged 27 commits into
main
from
seo/Improve-PortalJS-template's-SEO-features
Jun 26, 2025
+657
−58
Merged
Changes from 6 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
974340e
[seo][lg]: central SEO config file created
Datopian-Shreyas b779116
[seo][xs]: modified seo-config-file
Datopian-Shreyas 92a0ae8
[seo][md]: added jsonLd for homepage
Datopian-Shreyas 417d2eb
[seo][md]: added jsonLd for organization page
Datopian-Shreyas 3ebfdd6
[seo][md]: added jsonLd for search page
Datopian-Shreyas 61bf865
[seo][md]: added jsonLd for org individual page
Datopian-Shreyas 3abf4c4
[seo][md]: added jsonLd for dataset page
Datopian-Shreyas 7104cc2
[seo][md]: added jsonLd for groups page
Datopian-Shreyas e38930e
[seo][xs]: added jsonLd for groups page
Datopian-Shreyas 41f9399
[seo][lg]: added jsonLd for groups page and resource page
Datopian-Shreyas a49b231
[seo][lg]: breadcrumbLD fixes
Datopian-Shreyas 634245b
[seo][xs]: small fix
Datopian-Shreyas 7ca5ed8
[seo][xxl]: improved and fixed the nextseo component
Datopian-Shreyas 555341c
[seo][sm]:Handled undefined resource properties in JSON-LD.
Datopian-Shreyas 0791451
[seo][xs]: small fix
Datopian-Shreyas dcf5c54
[seo][xs]: manifest icon fixes
Datopian-Shreyas 1f13583
[seo][xs]: indidual org page fixes
Datopian-Shreyas 67b66d0
[seo][xs]: added types for structured data
Datopian-Shreyas 6968b97
[seo][xs]: Added null safety for organization property access and Add…
Datopian-Shreyas 7f6f34b
[seo][xs]: updated next-seo
Datopian-Shreyas ec474a4
[seo][xs]: updated next-seo
Datopian-Shreyas 15f6084
[seo][xs]: updated next-seo
Datopian-Shreyas b86d9f3
[seo][xs]: updated next-seo
Datopian-Shreyas 7bdc681
[seo][xs]: title updation on org and groups
Datopian-Shreyas 655456a
[seo][xs]: small fix
Datopian-Shreyas 4227069
[seo][xs]: search page title changed
Datopian-Shreyas 143c491
[seo][xs]: added default title
Datopian-Shreyas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import nextSeoConfig, { url } from "@/next-seo.config"; | ||
import { BreadcrumbJsonLd, LogoJsonLd, NextSeo, WebPageJsonLd, SiteLinksSearchBoxJsonLd } from "next-seo"; | ||
|
||
export function HomePageStructuredData() { | ||
return ( | ||
<> | ||
<LogoJsonLd | ||
url={url} | ||
logo={`${url}/favicon.ico`} | ||
/> | ||
<NextSeo | ||
{...nextSeoConfig} | ||
/> | ||
<BreadcrumbJsonLd | ||
itemListElements={[ | ||
{ | ||
position: 1, | ||
name: 'Home', | ||
item: url, | ||
}, | ||
]} | ||
/> | ||
<WebPageJsonLd | ||
id={`${url}#webpage`} | ||
url={url} | ||
name={nextSeoConfig.title} | ||
description={nextSeoConfig.description} | ||
/> | ||
<SiteLinksSearchBoxJsonLd | ||
url={url} | ||
potentialActions={[ | ||
{ | ||
target: `${url}/search?q={search_term_string}`, | ||
queryInput: "required name=search_term_string", | ||
}, | ||
]} | ||
/> | ||
</> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
components/schema/OrganizationIndividualPageStructuredData.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import nextSeoConfig, { url } from "@/next-seo.config"; | ||
import { BreadcrumbJsonLd, LogoJsonLd, NextSeo, WebPageJsonLd, SiteLinksSearchBoxJsonLd } from "next-seo"; | ||
|
||
export function OrganizationIndividualPageStructuredData({ org }) { | ||
const title = org.name || org.title | ||
const description = org.notes || "Organizations page of " + org | ||
Datopian-Shreyas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return ( | ||
<> | ||
<LogoJsonLd | ||
url={`${url}/@${title}`} | ||
Datopian-Shreyas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
logo={org.image_display_url || `${url}/favicon.ico`} | ||
/> | ||
<NextSeo | ||
canonical={`${url}/@${title}`} | ||
title={title} | ||
description={description} | ||
{...nextSeoConfig} | ||
/> | ||
<BreadcrumbJsonLd | ||
itemListElements={[ | ||
{ | ||
position: 1, | ||
name: 'Home', | ||
item: url, | ||
}, | ||
{ | ||
position: 2, | ||
name: 'Organizations', | ||
item: `${url}/@${title}`, | ||
}, | ||
]} | ||
/> | ||
<WebPageJsonLd | ||
id={`${url}/@${title}#webpage`} | ||
url={`${url}/@${title}`} | ||
name={title} | ||
description={description} | ||
/> | ||
</> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import nextSeoConfig, { url } from "@/next-seo.config"; | ||
import { BreadcrumbJsonLd, LogoJsonLd, NextSeo, WebPageJsonLd, SiteLinksSearchBoxJsonLd } from "next-seo"; | ||
|
||
export function OrganizationPageStructuredData() { | ||
const title = "Organizations page" | ||
const description = "Organizations page of " + title | ||
return ( | ||
<> | ||
<LogoJsonLd | ||
url={`${url}/organizations`} | ||
logo={`${url}/favicon.ico`} | ||
/> | ||
<NextSeo | ||
canonical={`${url}/organizations`} | ||
title={title} | ||
description={description} | ||
{...nextSeoConfig} | ||
/> | ||
<BreadcrumbJsonLd | ||
itemListElements={[ | ||
{ | ||
position: 1, | ||
name: 'Home', | ||
item: url, | ||
}, | ||
{ | ||
position: 2, | ||
name: 'Organizations', | ||
item: `${url}/organizations`, | ||
}, | ||
]} | ||
/> | ||
<WebPageJsonLd | ||
id={`${url}/organizations#webpage`} | ||
url={`${url}/organizations`} | ||
name={title} | ||
description={description} | ||
/> | ||
<SiteLinksSearchBoxJsonLd | ||
url={`${url}/organizations`} | ||
potentialActions={[ | ||
{ | ||
target: `${url}/organizations`, | ||
queryInput: "search_term_string" | ||
}, | ||
]} | ||
/> | ||
</> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import nextSeoConfig, { url } from "@/next-seo.config"; | ||
import { BreadcrumbJsonLd, LogoJsonLd, NextSeo, SiteLinksSearchBoxJsonLd } from "next-seo"; | ||
import Script from "next/script"; | ||
|
||
export function SearchPageStructuredData() { | ||
const title = "Search page" | ||
const description = "Browse through multiple datasets available on " + title | ||
const jsonLd = { | ||
"@context": "https://schema.org", | ||
"@type": "DataCatalog", | ||
"name": title, | ||
"description": description, | ||
"url": url + "/search", | ||
}; | ||
return ( | ||
<> | ||
<LogoJsonLd | ||
url={`${url}/search`} | ||
logo={`${url}/favicon.ico`} | ||
/> | ||
<NextSeo | ||
canonical={`${url}/search`} | ||
title={title} | ||
description={description} | ||
{...nextSeoConfig} | ||
/> | ||
<BreadcrumbJsonLd | ||
itemListElements={[ | ||
{ | ||
position: 1, | ||
name: 'Home', | ||
item: url, | ||
}, | ||
{ | ||
position: 2, | ||
name: 'Search', | ||
item: `${url}/search`, | ||
}, | ||
]} | ||
/> | ||
<Script | ||
id="datacatalog-jsonld" | ||
type="application/ld+json" | ||
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }} | ||
/> | ||
<SiteLinksSearchBoxJsonLd | ||
url={`${url}/search`} | ||
potentialActions={[ | ||
{ | ||
target: `${url}/search?q={search_term_string}`, | ||
queryInput: "search_term_string" | ||
}, | ||
]} | ||
/> | ||
</> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,74 @@ | ||
/* eslint-disable import/no-anonymous-default-export */ | ||
|
||
const title = "PortalJS Open Data Portal"; | ||
const description = | ||
"Discover thousands of datasets, publish your own, and request data via Portal – an open data platform powered by PortalJS."; | ||
|
||
export const url = "https://portaljs-cloud-frontend-template.vercel.app"; | ||
const imageUrl = `${url}/images/portaljs-frontend.png`; | ||
|
||
export default { | ||
titleTemplate: "%s | Ckan Homepage", | ||
description: "Ckan Homepage", | ||
canonical: "https://datahub-enterprise.vercel.app/", | ||
title, | ||
titleTemplate: "%s | PortalJS", | ||
description, | ||
canonical: url, | ||
Datopian-Shreyas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
openGraph: { | ||
title: "Ckan Homepage", | ||
title, | ||
description, | ||
type: "website", | ||
url: "https://datahub-enterprise.vercel.app/", | ||
site_name: "Ckan Homepage", | ||
locale: "en_US", | ||
url, | ||
site_name: title, | ||
images: [ | ||
{ | ||
url: "https://datahub-enterprise.vercel.app/images/datahub_enterprise_frontend.png", | ||
alt: "Ckan Homepage", | ||
url: imageUrl, | ||
alt: title, | ||
width: 1200, | ||
height: 627, | ||
type: "image/jpg", | ||
type: "image/png", | ||
}, | ||
], | ||
}, | ||
// twitter: { | ||
// handle: "@datahubenterprise", | ||
// site: "https://datahub-enterprise.vercel.app/", | ||
// cardType: "summary_large_image", | ||
// }, | ||
twitter: { | ||
handle: "@datopian", | ||
site: "@PortalJS_", | ||
cardType: "summary_large_image", | ||
}, | ||
additionalMetaTags: [ | ||
{ | ||
name: "keywords", | ||
content: "PortalJS, open data, datasets, data portal, Portal, datopian, frontend template", | ||
}, | ||
{ | ||
name: "author", | ||
content: "Datopian / PortalJS", | ||
}, | ||
{ | ||
property: "og:image:width", | ||
content: "1200", | ||
}, | ||
{ | ||
property: "og:image:height", | ||
content: "627", | ||
}, | ||
{ | ||
property: "og:locale", | ||
content: "en_US", | ||
}, | ||
], | ||
additionalLinkTags: [ | ||
{ | ||
rel: "icon", | ||
href: "/favicon.ico", | ||
}, | ||
{ | ||
rel: "apple-touch-icon", | ||
href: "/apple-touch-icon.png", | ||
sizes: "180x180", | ||
}, | ||
{ | ||
rel: "manifest", | ||
href: "/site.webmanifest", | ||
}, | ||
] | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.