diff --git a/src/content/faq.json b/src/content/faq.json index 05ffab16..2ed388aa 100644 --- a/src/content/faq.json +++ b/src/content/faq.json @@ -34,12 +34,19 @@ { "section": "2 Inventory Content/What’s New", "question": "What are Geophysical Concepts?", - "answer": "Geophysical concepts are terms that correlate to the six NASA Earth Science Focus Areas and the Global Change Master Directory (GCMD) Earth Science Keywords, bridging the gap between the general and specific terms used to describe scientific studies and data. {{concepts}}", + "answer": "{{link.geophysicalconcepts}} are terms that correlate to the six NASA Earth Science Focus Areas and the Global Change Master Directory (GCMD) Earth Science Keywords, bridging the gap between the general and specific terms used to describe scientific studies and data. {{concepts}}", "images": [ { "id": "concepts", "alt": "Relationship between geophysical concepts, NASA Earth Science Focus Areas, and GCMD Earth Science Keywords" } + ], + "links": [ + { + "id": "link.geophysicalconcepts", + "text": "Geophysical concepts", + "url": "https://drive.google.com/file/d/1YvQ6iR5S_ehJ4cTP87q6Y7odQ8oW5gg0/view?usp=drive_link" + } ] }, { diff --git a/src/content/glossary.json b/src/content/glossary.json index 02d4176c..b798bda0 100644 --- a/src/content/glossary.json +++ b/src/content/glossary.json @@ -31,7 +31,7 @@ }, { "term": "Instrument Package", - "definition": "All instruments operating on a platform. This may consist of a single instrument or multiple individual instruments and any associated technology such as power systems or telecommunications hardware. The instrument package used on a given platform can change over time, by flight, deployment, or field investigation, in order to support specific science/research objectives or due to an individual instrument failure.", + "definition": "All instruments operating on a platform. This may consist of a single instrument or multiple individual instruments and any associated technology such as power systems or telecommunications hardware. The instrument package used on a given platform can change over time, by flight, deployment, or field investigation, in order to support specific science/research objectives or due to an individual instrument failure.", "note": "Note that individuals, science teams, or research groups may also refer to the instrument package as the instrument payload, particularly for airborne platforms." }, { @@ -64,10 +64,17 @@ }, { "term": "Geophysical Concept", - "definition": "High-level science concepts identified by ADMG as a means to bridge the necessary generality of NASA’s Earth Science Focus Areas and the inherent specificity of the GCMD Science Keywords. These intermediary concepts are intended to facilitate improved communication and contextual use of both the NASA Earth Science Focus Areas and the GCMD Earth Science Keywords, bearing in mind the many-to-many relationships among them and the fundamental interconnectedness of the various processes that comprise the Earth system. There are currently 26 ADMG-identified geophysical concepts which can be assigned as metadata in CASEI to categorize a field investigation with respect to its purpose, goals, effort, or findings." + "definition": "High-level science concepts identified by ADMG as a means to bridge the necessary generality of NASA’s Earth Science Focus Areas and the inherent specificity of the GCMD Science Keywords. These intermediary concepts are intended to facilitate improved communication and contextual use of both the NASA Earth Science Focus Areas and the GCMD Earth Science Keywords, bearing in mind the many-to-many relationships among them and the fundamental interconnectedness of the various processes that comprise the Earth system. There are currently 26 {{link.geophysicaldoc}} which can be assigned as metadata in CASEI to categorize a field investigation with respect to its purpose, goals, effort, or findings.", + "links": [ + { + "id": "link.geophysicaldoc", + "text": "ADMG-identified geophysical concepts", + "url": "https://drive.google.com/file/d/1YvQ6iR5S_ehJ4cTP87q6Y7odQ8oW5gg0/view?usp=drive_link" + } + ] }, { "term": "Assigned DAAC", "definition": "The DAAC designated by NASA's Earth Science Data Systems (ESDS) Program to have the responsibility of ensuring proper stewardship of the data and information for an investigation or facility instrument/major airborne instrument. Until recently, formal DAAC assignments were not often completed. Therefore, for older field investigations with data products already within the EOSDIS system, the DAAC that distributes the majority of the data is considered, by default, the assigned DAAC. If data products from a field investigation are archived and distributed by separate DAACs, it is the responsibility of the assigned DAAC to organize all information, clearly identify all data products, provide additional metadata and information links, and obtain a data product group DOI to represent all the data products resulting from an investigation, as needed. The assigned DAAC must maintain all links and preserve all materials needed to fully understand the data products and the campaign context in the future. For historical data not yet available in EOSDIS and the Common Metadata Repository (CMR), a DAAC-assignment procedure is followed to assign the historical field investigation to a DAAC for data publication." } -] +] \ No newline at end of file diff --git a/src/pages/glossary.js b/src/pages/glossary.js index 1b556c6f..c0c777ac 100644 --- a/src/pages/glossary.js +++ b/src/pages/glossary.js @@ -3,7 +3,6 @@ import PropTypes from "prop-types" import { graphql } from "gatsby" import { GatsbyImage } from "gatsby-plugin-image" import VisuallyHidden from "@reach/visually-hidden" - import Layout, { PageBody, SectionHeader, @@ -253,7 +252,9 @@ export default function Glossary({ data }) { slimPadding >

{x.term}

-

{x.definition}

+
+ {x.links ? : x.definition} +
{x.note && (

{ + const templatePattern = /{{\s?([^{}\s]*)\s?}}/g + // split definition text by the template pattern + const parts = node.definition.split(templatePattern) + // map over parts and perform replacement + return ( +

+ {parts.map((part, index) => { + // return first element of parts array which matches node.id + // eslint-disable-next-line + const link = node.links?.find(link => link.id === part) + + // if a part matches link.id, replace that part with an ExternalLink, and reconcat as node.definition + if (link) { + return ( + // eslint-disable-next-line + + + + ) + } + // Otherwise, return the part as is + return part + })} +
+ ) +} + +LinkSection.propTypes = { + node: PropTypes.shape({ + definition: PropTypes.string.isRequired, + links: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + url: PropTypes.string.isRequired, + }) + ), + }).isRequired, +} + export const query = graphql` { allGlossaryJson { @@ -282,6 +329,11 @@ export const query = graphql` term definition note + links { + id + text + url + } } } image: file(relativePath: { eq: "glossary-map.jpeg" }) { @@ -300,6 +352,13 @@ Glossary.propTypes = { term: PropTypes.string.isRequired, definition: PropTypes.string.isRequired, note: PropTypes.string, + links: PropTypes.PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string, + text: PropTypes.string, + url: PropTypes.string, + }) + ), }) ), }).isRequired, diff --git a/src/templates/campaign/index.js b/src/templates/campaign/index.js index 77d6d04b..f6257be2 100644 --- a/src/templates/campaign/index.js +++ b/src/templates/campaign/index.js @@ -366,7 +366,7 @@ CampaignTemplate.propTypes = { PropTypes.shape({ cmrTitle: PropTypes.string.isRequired, doi: PropTypes.string.isRequired, - format: PropTypes.string, + formats: PropTypes.string, id: PropTypes.string.isRequired, longname: PropTypes.string, }) diff --git a/src/templates/instrument/index.js b/src/templates/instrument/index.js index 80ab6485..37cc7877 100644 --- a/src/templates/instrument/index.js +++ b/src/templates/instrument/index.js @@ -137,7 +137,7 @@ InstrumentTemplate.propTypes = { dois: PropTypes.arrayOf( PropTypes.shape({ cmrTitle: PropTypes.string.isRequired, - format: PropTypes.string, + formats: PropTypes.string, doi: PropTypes.string.isRequired, id: PropTypes.string.isRequired, longname: PropTypes.string, diff --git a/src/templates/platform/index.js b/src/templates/platform/index.js index 6c8109ef..d06b05dc 100644 --- a/src/templates/platform/index.js +++ b/src/templates/platform/index.js @@ -183,7 +183,7 @@ PlatformTemplate.propTypes = { dois: PropTypes.arrayOf( PropTypes.shape({ cmrTitle: PropTypes.string.isRequired, - format: PropTypes.string, + formats: PropTypes.string, doi: PropTypes.string.isRequired, id: PropTypes.string.isRequired, longname: PropTypes.string,