Skip to content

Commit a3a8d10

Browse files
committed
updating title and description files
1 parent 28658b1 commit a3a8d10

2 files changed

Lines changed: 53 additions & 26 deletions

File tree

src/pages/all/+description.js

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export default function description(pageContext) {
6060
"A registry of data preservation, management and sharing policies from international funding agencies, regulators, journals, and other organisations.",
6161
"/collections":
6262
'Collections group together one or more types of resource (standard, database or policy) by domain, project or organisation."',
63+
"/fairassist":
64+
'FAIRsharing provides a registry that stores records relating to FAIR assistance and evaluation, initially developed as part of the OSTrails project but open to all assessment tools. The types of records within this registry are defined here, as well as how those record types align with community-developed frameworks and standards."',
6365
"/browse/subject":
6466
"Subject Browser helps you navigate the subjects hierarchy and find the standards, repositories, and policies relevant to you.",
6567
};
@@ -70,24 +72,34 @@ export default function description(pageContext) {
7072

7173
// Search pages (Robust URL query extraction via URLSearchParams)
7274
const searchParams = new URLSearchParams(pageContext.urlParsed?.search || "");
73-
const registry = searchParams.get("fairsharingRegistry");
75+
if (path === "/search") {
76+
const registry = searchParams.get("fairsharingRegistry");
77+
const allowedRegistries = [
78+
"standard",
79+
"database",
80+
"policy",
81+
"collection",
82+
"fairassist",
83+
];
84+
const defaultSearchTitle = "Search | FAIRsharing";
7485

75-
if (registry) {
76-
const registryDescriptions = {
77-
standard:
78-
"A registry of terminology artefacts, models/formats, reporting guidelines, and identifier schemas.",
79-
database:
80-
"A registry of knowledgebases and repositories of data and other digital assets.",
81-
policy:
82-
"A registry of data preservation, management and sharing policies from international funding agencies, regulators, journals, and other organisations.",
83-
collection:
84-
"Collections group together one or more types of resource (standard, database or policy) by domain, project or organisation.",
85-
};
86+
if (registry) {
87+
const normalizedRegistry = registry.toLowerCase();
88+
89+
// heck if the param is one of your specific keys
90+
if (allowedRegistries.includes(normalizedRegistry)) {
91+
const registryTitles = {
92+
standard: "Standards | FAIRsharing",
93+
database: "Databases | FAIRsharing",
94+
policy: "Policies | FAIRsharing",
95+
collection: "Collections | FAIRsharing",
96+
fairassist: "Fairassist | FAIRsharing",
97+
};
8698

87-
const matchedDescription = registryDescriptions[registry.toLowerCase()];
88-
if (matchedDescription) {
89-
return matchedDescription;
99+
return registryTitles[normalizedRegistry];
100+
}
90101
}
102+
return defaultSearchTitle;
91103
}
92104

93105
//Global Fallback

src/pages/all/+title.js

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default function title(pageContext) {
4343
"/databases": "Databases | FAIRsharing",
4444
"/policies": "Policies | FAIRsharing",
4545
"/collections": "Collections | FAIRsharing",
46+
"/fairassist": "Fairassist | FAIRsharing",
4647
"/browse/subject": "Subject Browser| FAIRsharing",
4748
};
4849

@@ -51,20 +52,34 @@ export default function title(pageContext) {
5152
}
5253

5354
const searchParams = new URLSearchParams(pageContext.urlParsed?.search || "");
54-
const registry = searchParams.get("fairsharingRegistry");
55+
if (path === "/search") {
56+
const registry = searchParams.get("fairsharingRegistry");
57+
const allowedRegistries = [
58+
"standard",
59+
"database",
60+
"policy",
61+
"collection",
62+
"fairassist",
63+
];
64+
const defaultSearchTitle = "Search | FAIRsharing";
5565

56-
if (registry) {
57-
const registryTitles = {
58-
standard: "Standards | FAIRsharing",
59-
database: "Databases | FAIRsharing",
60-
policy: "Policies | FAIRsharing",
61-
collection: "Collections | FAIRsharing",
62-
};
66+
if (registry) {
67+
const normalizedRegistry = registry.toLowerCase();
68+
69+
// heck if the param is one of your specific keys
70+
if (allowedRegistries.includes(normalizedRegistry)) {
71+
const registryTitles = {
72+
standard: "Standards | FAIRsharing",
73+
database: "Databases | FAIRsharing",
74+
policy: "Policies | FAIRsharing",
75+
collection: "Collections | FAIRsharing",
76+
fairassist: "Fairassist | FAIRsharing",
77+
};
6378

64-
const matchedTitle = registryTitles[registry.toLowerCase()];
65-
if (matchedTitle) {
66-
return matchedTitle;
79+
return registryTitles[normalizedRegistry];
80+
}
6781
}
82+
return defaultSearchTitle;
6883
}
6984

7085
return "FAIRsharing";

0 commit comments

Comments
 (0)