diff --git a/data/dataProviders.yml b/data/dataProviders.yml new file mode 100644 index 00000000..71e31565 --- /dev/null +++ b/data/dataProviders.yml @@ -0,0 +1,68 @@ +navItems: + - item: | + **1. Who this document is for** + href: '#usage' + - item: | + **2. Terminology** + href: "#terminology" + - item: | + **3. Requirements and guidelines for indexing repository content** + href: "#guideline" + - item: 3.1 Repository configuration + href: "#configuration" + - item: 3.1.1 Ensuring your repository is visible via OAI-PMH (Required) + href: "#oai-pmh" + - item: 3.1.2 Data providers considering registration with CORE + href: "#registration" + - item: Data providers registering with CORE + href: "#processing" + hidden: true + - item: Data providers already registered in CORE + href: "#already" + hidden: true + - item: 3.1.3 Use of OAI-PMH sets (Required) + href: "#oai-pmh-usage" + - item: 3.1.4 OAI identifiers (Required) + href: "#oai-identifier" + - item: 3.1.5 Access for machine agents - (Required) + href: "#machine-agents" + - item: 3.1.6 Repository registration in open registries (Recommended) + href: "#open-registries" + - item: 3.1.7 Meta-tags (Recommended) + href: "#meta-tags" + - item: 3.2 Metadata Configuration + href: "#meta-configuration" + - item: 3.2.1 Supported application profiles (Required) + href: "#supported-application" + - item: i. Dublin Core / Extended Dublin Core (Minimum) + href: "#dublin-core" + - item: ii. OpenAIRE Guidelines (Supported) + href: "#openaire" + - item: iii. RIOXX v3 (Recommended) + href: "#rioxx" + - item: 3.3 Full text configuration + href: "#text-configuration" + - item: 3.3.1 Supported full-text formats (Required) + href: "#full-text" + - item: 3.3.2 Same-domain policy for hosting full texts (Required) + href: "#same-domain" + - item: 3.3.3 Linking to the full text of an article + href: "#linking-full-text" + - item: i. Direct link to the full text (Recommended) + href: "#Direct-full-text" + - item: ii. Indirect link to the full text (Supported) + href: "#indirect-link" + - item: 3.3.4 FAIR Signposting (Recommended) + href: "#fair-signposting" + - item: | + **4. Registering a data provider with CORE** + href: "#data-provider" + - item: 4.1 Submitting the data provider OAI base URL (Required) + href: "#oai-base" + - item: 4.2 Indexing the data provider’s content + href: "#indexing" + - item: 4.3 Claiming access to the CORE Dashboard (Recommended) + href: "#dashboard" + - item: | + **5. Further reading** + href: "#reading" diff --git a/data/membership.yml b/data/membership.yml index 3d511e4a..c94e0f9e 100644 --- a/data/membership.yml +++ b/data/membership.yml @@ -27,7 +27,7 @@ content: id: 1 title: CORE Repository Dashboard descriptionCardCard: | - [Monitor, manage and access](~services/repository-dashboard) statistics about how your metadata are exposed across the open access research network. [read more](~membership-documentation#dashboard) + [Monitor, manage and access](~services/repository-dashboard) statistics about how your metadata are exposed across the open access research network. [read more](~documentations#dashboard) descriptionCardTable: | Monitor, manage and access statistics about how your metadata are exposed across the open access research network. plans: [Starting, Supporting, Sustaining] @@ -35,7 +35,7 @@ content: id: 2 title: CORE Discovery descriptionCardCard: | - Benefit from our [plugin](~services/discovery) which turns metadata only pages in repositories to pages with full text links, whenever an open access version of the document is available anywhere across the open research network. [read more](~membership-documentation#discovery) + Benefit from our [plugin](~services/discovery) which turns metadata only pages in repositories to pages with full text links, whenever an open access version of the document is available anywhere across the open research network. [read more](~documentations#discovery) descriptionCardTable: | Benefit from our plugin which turns metadata only pages in repositories to pages with full text links, whenever an open access version of the document is available anywhere across the open research network. plans: [Starting, Supporting, Sustaining] @@ -43,7 +43,7 @@ content: id: 3 title: CORE Search descriptionCardCard: | - Your organisation's research visible and discoverable by over 30 million monthly active users who rely on CORE. [read more](~membership-documentation#search) + Your organisation's research visible and discoverable by over 30 million monthly active users who rely on CORE. [read more](~documentations#search) descriptionCardTable: | Your organisation's research visible and discoverable by over 30 million monthly active users who rely on CORE. plans: [Starting, Supporting, Sustaining] @@ -51,7 +51,7 @@ content: id: 4 title: CORE Recommender descriptionCardCard: | - Install our [recommender plugin](~services/recommender) to help your users find related content within your own repository and from across the global open research network. [read more](~membership-documentation#recommender) + Install our [recommender plugin](~services/recommender) to help your users find related content within your own repository and from across the global open research network. [read more](~documentations#recommender) descriptionCardTable: | Install our recommender plugin to help your users find related content within your own repository and from across the global open research network. plans: [Starting, Supporting, Sustaining] @@ -59,7 +59,7 @@ content: id: 5 title: General support descriptionCardCard: | - Our enthusiastic open access team ready to answer general queries about CORE. [read more](~membership-documentation#general-support) + Our enthusiastic open access team ready to answer general queries about CORE. [read more](~documentations#general-support) descriptionCardTable: | Our enthusiastic open access team ready to answer general queries about CORE. plans: [Starting, Supporting, Sustaining] @@ -67,7 +67,7 @@ content: id: 6 title: Download statistics descriptionCardCard: | - Access statistics about how many times papers from your organisation were downloaded (from CORE and directly from your repository - IRUS tracker integration required for the latter). [read more](~membership-documentation#download-statistics) + Access statistics about how many times papers from your organisation were downloaded (from CORE and directly from your repository - IRUS tracker integration required for the latter). [read more](~documentations#download-statistics) descriptionCardTable: | Access statistics about how many times papers from your organisation were downloaded (from CORE and directly from your repository - IRUS tracker integration required for the latter). plans: [Starting, Supporting, Sustaining] @@ -81,7 +81,7 @@ content: – Recommended across the repositories network descriptionCardCard: |- - – Increases the discoverability of your content. Open access full texts from your repository promoted to PubMed Central via their Link Out service. [read more](~membership-documentation#repository-discovery-boost) + – Increases the discoverability of your content. Open access full texts from your repository promoted to PubMed Central via their Link Out service. [read more](~documentations#repository-discovery-boost) descriptionCardTable: |- – Increases the discoverability of your content. Open access full texts from your repository promoted to PubMed Central via their Link Out service. plans: [Starting, Supporting, Sustaining] @@ -89,7 +89,7 @@ content: title: Get your OAI identifiers resolved to your repository id: 8 descriptionCardCard: | - Make [OAI identifiers](https://oai.core.ac.uk) originating from your repository resolve directly to your repository in the OAI Resolver. [read more](~membership-documentation#OAI-identifiers) + Make [OAI identifiers](https://oai.core.ac.uk) originating from your repository resolve directly to your repository in the OAI Resolver. [read more](~documentations#OAI-identifiers) descriptionCardTable: | Make OAI identifiers originating from your repository resolve directly to your repository in the OAI Resolver. plans: [ Starting, Supporting, Sustaining ] @@ -97,7 +97,7 @@ content: id: 9 title: Logos for your papers descriptionCardCard: | - Associate your research papers in CORE with your official organisational logo. This will be visible in CORE Search, CORE Recommender, CORE Discovery and from across the CORE Portal. Your logo can be uploaded from the CORE Repository Dashboard. [read more](~membership-documentation#logos-papers) + Associate your research papers in CORE with your official organisational logo. This will be visible in CORE Search, CORE Recommender, CORE Discovery and from across the CORE Portal. Your logo can be uploaded from the CORE Repository Dashboard. [read more](~documentations#logos-papers) descriptionCardTable: | Associate your research papers in CORE with your official organisational logo. This will be visible in CORE Search, CORE Recommender, CORE Discovery and from across the CORE Portal. Your logo can be uploaded from the CORE Repository Dashboard. plans: [Supporting, Sustaining] @@ -105,7 +105,7 @@ content: id: 10 title: Logo banner descriptionCardCard: | - We highly value the generous support of our Supporting and Sustaining members. We proudly display banners acknowledging your sponsorship and support to the open access and open science mission. [read more](~membership-documentation#logo-banner) + We highly value the generous support of our Supporting and Sustaining members. We proudly display banners acknowledging your sponsorship and support to the open access and open science mission. [read more](~documentations#logo-banner) descriptionCardTable: | We highly value the generous support of our Supporting and Sustaining members. We proudly display banners acknowledging your sponsorship and support to the open access and open science mission. plans: [Supporting, Sustaining] @@ -113,7 +113,7 @@ content: id: 11 title: Personalised banner descriptionCardCard: | - Promote your research conferences, events, academic jobs and other mission-aligned communications on the CORE website. [read more](~membership-documentation#personalised-banner) + Promote your research conferences, events, academic jobs and other mission-aligned communications on the CORE website. [read more](~documentations#personalised-banner) descriptionCardTable: | Promote your research conferences, events, academic jobs and other mission-aligned communications on the CORE website. plans: [Sustaining] @@ -121,7 +121,7 @@ content: id: 12 title: Board of Supporters (1 vote) descriptionCardCard: | - Help shape our development roadmap by having a say on our [Board of Supporters](~governance/supporters). [read more](~membership-documentation#board-supporters) + Help shape our development roadmap by having a say on our [Board of Supporters](~governance/supporters). [read more](~documentations#board-supporters) descriptionCardTable: | Help shape our development roadmap by having a say on our Board of Supporters. plans: [Supporting, Sustaining] @@ -129,7 +129,7 @@ content: id: 13 title: Board of Supporters (2 votes) descriptionCardCard: | - Help shape our development roadmap by having a say on our Board of Supporters. [read more](~membership-documentation#board-supporters) + Help shape our development roadmap by having a say on our Board of Supporters. [read more](~documentations#board-supporters) descriptionCardTable: | Help shape our development roadmap by having a say on our Board of Supporters. plans: [Supporting, Sustaining] @@ -137,7 +137,7 @@ content: id: 14 title: Board of Supporters descriptionCardCard: | - Help shape our development roadmap by having a say on our [Board of Supporters](~governance/supporters). [read more](~membership-documentation#board-supporters) + Help shape our development roadmap by having a say on our [Board of Supporters](~governance/supporters). [read more](~documentations#board-supporters) descriptionCardTable: | Help shape our development roadmap by having a say on our Board of Supporters. plans: [Supporting, Sustaining] @@ -150,7 +150,7 @@ content: id: 15 title: Technical support (≤5) descriptionCardCard: | - Guaranteed technical support of up to 5 technical queries per year. [read more](~membership-documentation#technical-support) + Guaranteed technical support of up to 5 technical queries per year. [read more](~documentations#technical-support) descriptionCardTable: | Guaranteed technical support of up to 5 technical queries per year. plans: [Supporting, Sustaining] @@ -158,7 +158,7 @@ content: id: 16 title: Unlimited and prioritised support descriptionCardCard: | - Get unlimited technical support and your questions prioritised on top to get your answers sooner. [read more](~membership-documentation#unlimited-support) + Get unlimited technical support and your questions prioritised on top to get your answers sooner. [read more](~documentations#unlimited-support) descriptionCardTable: | Get unlimited technical support and your questions prioritised on top to get your answers sooner. plans: [Sustaining] @@ -166,7 +166,7 @@ content: id: 17 title: CORE OA Compliance dashboard descriptionCardCard: | - Tools for Open Access compliance monitoring and metadata enrichments. [read more](/membership-documentation#compliance-dashboard) + Tools for Open Access compliance monitoring and metadata enrichments. [read more](/documentations#compliance-dashboard) descriptionCardTable: | Tools for Open Access compliance monitoring and metadata enrichments. plans: [Sustaining] @@ -174,7 +174,7 @@ content: id: 18 title: АPI use for your university descriptionCardCard: | - Use of the [CORE API](~services/api) for your organisation, including for non-research purposes (except for commercial purposes), subject to our T&Cs. [read more](~membership-documentation#АPI-organisation) + Use of the [CORE API](~services/api) for your organisation, including for non-research purposes (except for commercial purposes), subject to our T&Cs. [read more](~documentations#АPI-organisation) descriptionCardTable: | Use of the CORE API for your organisation, including for non-research purposes (except for commercial purposes), subject to our T&Cs. plans: [Supporting, Sustaining] @@ -182,7 +182,7 @@ content: id: 19 title: Dataset use for your university descriptionCardCard: | - Use of the [CORE Dataset](~services/dataset) for your organisation, including for non-research purposes (except for commercial purposes), subject to our T&Cs. [read more](~membership-documentation#dataset-university) + Use of the [CORE Dataset](~services/dataset) for your organisation, including for non-research purposes (except for commercial purposes), subject to our T&Cs. [read more](~documentations#dataset-university) descriptionCardTable: | Use of the CORE Dataset for your organisation, including for non-research purposes (except for commercial purposes), subject to our T&Cs. plans: [Sustaining] @@ -190,7 +190,7 @@ content: id: 20 title: Repository health check descriptionCardCard: | - Possibility of a data-driven metadata quality assessment consultation for your institution. We assess current level of metadata quality (including in relation to FAIRness) and provide guidance on how to improve it. (1 consultation per year included). [read more](~membership-documentation#repository-health-check) + Possibility of a data-driven metadata quality assessment consultation for your institution. We assess current level of metadata quality (including in relation to FAIRness) and provide guidance on how to improve it. (1 consultation per year included). [read more](~documentations#repository-health-check) descriptionCardTable: | Possibility of a data-driven metadata quality assessment consultation for your institution. We assess current level of metadata quality (including in relation to FAIRness) and provide guidance on how to improve it. (1 consultation per year included). plans: [Sustaining] @@ -198,7 +198,7 @@ content: id: 21 title: Promoted / spotlight / featured articles descriptionCardCard: | - When research papers from your organisation would appear on pages 2-4 of CORE Search results, your paper gets promoted to the front of the first page and is highlighted as a featured article. [read more](~membership-documentation#promoted-articles) + When research papers from your organisation would appear on pages 2-4 of CORE Search results, your paper gets promoted to the front of the first page and is highlighted as a featured article. [read more](~documentations#promoted-articles) descriptionCardTable: | When research papers from your organisation would appear on pages 2-4 of CORE Search results, your paper gets promoted to the front of the first page and is highlighted as a featured article. plans: [Sustaining] @@ -206,7 +206,7 @@ content: id: 22 title: Hosted or interview style blog post on mission-aligned activities descriptionCardCard: | - We are keen to provide a hosted or interview style blog post about open access, open science and other relevant mission-oriented activities your organisation is conducting on the CORE blog. (T&Cs apply) [read more](~membership-documentation#hosted-activities) + We are keen to provide a hosted or interview style blog post about open access, open science and other relevant mission-oriented activities your organisation is conducting on the CORE blog. (T&Cs apply) [read more](~documentations#hosted-activities) descriptionCardTable: | We are keen to provide a hosted or interview style blog post about open access, open science and other relevant mission-oriented activities your organisation is conducting on the CORE blog. (T&Cs apply) plans: [Sustaining] @@ -214,7 +214,7 @@ content: id: 23 title: RIOXX metadata validator descriptionCardCard: | - Aligning with established metadata practices is key for the interoperability of your repository with external systems and for meeting FAIR principles. Funders increasingly mandate the use of established metadata profiles. The RIOXX metadata validator is a tool that helps you validate compliance of individual metadata records with RIOXX, a widely used metadata standard for repositories. [read more](~membership-documentation#rioxx-validator) + Aligning with established metadata practices is key for the interoperability of your repository with external systems and for meeting FAIR principles. Funders increasingly mandate the use of established metadata profiles. The RIOXX metadata validator is a tool that helps you validate compliance of individual metadata records with RIOXX, a widely used metadata standard for repositories. [read more](~documentations#rioxx-validator) descriptionCardTable: | Aligning with established metadata practices is key for the interoperability of your repository with external systems and for meeting FAIR principles. Funders increasingly mandate the use of established metadata profiles. The RIOXX metadata validator is a tool that helps you validate compliance of individual metadata records with RIOXX , a widely used metadata standard for repositories. plans: [Starting, Supporting, Sustaining] @@ -222,7 +222,7 @@ content: id: 24 title: Versions and duplicates detection descriptionCardCard: | - Our technology searches your repository to identify different versions of your articles and potential duplicates within your repository. This can help you in managing and curating your repository content. We periodically detect near-duplicate records and versions and allow you to compare them side by side. This can help you improve your repository metadata and keep the repository clean. [read more](~membership-documentation#versions-duplicates) + Our technology searches your repository to identify different versions of your articles and potential duplicates within your repository. This can help you in managing and curating your repository content. We periodically detect near-duplicate records and versions and allow you to compare them side by side. This can help you improve your repository metadata and keep the repository clean. [read more](~documentations#versions-duplicates) descriptionCardTable: | Our technology searches your repository to identify different versions of your articles and potential duplicates within your repository. This can help you in managing and curating your repository content. We periodically detect near-duplicate records and versions and allow you to compare them side by side. This can help you improve your repository metadata and keep the repository clean. plans: [Supporting, Sustaining] @@ -230,7 +230,7 @@ content: id: 25 title: Monitor RIOXX compliance descriptionCardCard: | - Aligning with established metadata practices is key for the interoperability of your repository with external systems and for meeting FAIR principles. Funders increasingly mandate the use of established metadata profiles. The Monitor RIOXX Compliance feature constantly monitors metadata records in your repository, helping you to keep your repository FAIR. [read more](~membership-documentation#rioxx-compliance) + Aligning with established metadata practices is key for the interoperability of your repository with external systems and for meeting FAIR principles. Funders increasingly mandate the use of established metadata profiles. The Monitor RIOXX Compliance feature constantly monitors metadata records in your repository, helping you to keep your repository FAIR. [read more](~documentations#rioxx-compliance) descriptionCardTable: | Aligning with established metadata practices is key for the interoperability of your repository with external systems and for meeting FAIR principles. Funders increasingly mandate the use of established metadata profiles. The Monitor RIOXX Compliance feature constantly monitors metadata records in your repository, helping you to keep your repository FAIR. plans: [Supporting, Sustaining] @@ -246,7 +246,7 @@ plans: content: Organisations who want to be widely recognised for their open research. In addition to all the STARTING benefits, this membership also comes with extra visibility for your organisation in the OA network, additional technical support, [CORE API](~services/api) access for your researchers, and a seat on our [Board of Supporters](~governance/supporters). - title: | SUSTAINING for: - content: Organisations who want to be seen as open research champions. In addition to all the SUPPORTING benefits, this membership comes with additional tools to help stay compliant with [OA policies](/membership-documentation/?r=compliance-dashboard) and FAIR, unlimited technical support, [CORE Dataset](https://core.ac.uk/services/dataset) access for your researchers for text and data mining, and two seats on our Board of Supporters + content: Organisations who want to be seen as open research champions. In addition to all the SUPPORTING benefits, this membership comes with additional tools to help stay compliant with [OA policies](/documentations/?r=compliance-dashboard) and FAIR, unlimited technical support, [CORE Dataset](https://core.ac.uk/services/dataset) access for your researchers for text and data mining, and two seats on our Board of Supporters cards: - title: Starting caption: Free @@ -345,7 +345,7 @@ how-it-works: active: Comparison table - action: caption: Access documentation - url: /membership-documentation + url: /documentations comparison-table: title: Features’ details and comparison @@ -633,3 +633,9 @@ navItems: href: "#hosted-activities" - item: CORE badges href: "#core-badges" + +documentationSwitcher: + - title: CORE Data Provider’s Guide + description: In this documentation you can find all detailed information about becoming CORE data provider. + - title: Membership Documentation + description: In this documentation you can find an instruction about how to interact with all features of CORE Memberships. diff --git a/package-lock.json b/package-lock.json index 52ede884..8fe39bb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1935,9 +1935,9 @@ "integrity": "sha512-qtBF56vPC6d6a8p7LYd0iRjW89fhY80kAIzmj+VonvIGjK/nymBjcFUhbKiMFqlhsarCksnhwX+Zmn95Dw9qvA==" }, "@oacore/design": { - "version": "4.9.49", - "resolved": "https://npm.pkg.github.com/download/@oacore/design/4.9.49/947d4c81ca79d2c2b1d7c05ad3be484d969a3b9c", - "integrity": "sha512-f9+yWOfYaL1838XmsYPKV42dQV80EPAivB7Z89ko9oxdqo6n5BHBVTKSxfewEcV2Dhlh//FHBxflbA0tCpQAGA==", + "version": "4.9.54", + "resolved": "https://npm.pkg.github.com/download/@oacore/design/4.9.54/46da36346978b8b7634c4cb32cd667bac270fed7", + "integrity": "sha512-bhdUWofcTrsneHpuFcAorFqRncGhynBZYsOOICO+AJ0ODmRFg8zO5R2APdxCGz/XnC5DYanEAec2qSVapINS2Q==", "requires": { "@babel/runtime": "^7.12.1", "@mdi/svg": "^5.8.55", @@ -5043,9 +5043,9 @@ "dev": true }, "focus-lock": { - "version": "0.11.6", - "resolved": "https://registry.npmjs.org/focus-lock/-/focus-lock-0.11.6.tgz", - "integrity": "sha512-KSuV3ur4gf2KqMNoZx3nXNVhqCkn42GuTYCX4tXPEwf0MjpFQmNMiN6m7dXaUXgIoivL6/65agoUMg4RLS0Vbg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/focus-lock/-/focus-lock-1.0.0.tgz", + "integrity": "sha512-a8Ge6cdKh9za/GZR/qtigTAk7SrGore56EFcoMshClsh7FLk1zwszc/ltuMfKhx56qeuyL/jWQ4J4axou0iJ9w==", "requires": { "tslib": "^2.0.3" } @@ -6146,9 +6146,9 @@ } }, "katex": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.8.tgz", - "integrity": "sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==", + "version": "0.16.9", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.9.tgz", + "integrity": "sha512-fsSYjWS0EEOwvy81j3vRA8TEAhQhKiqO+FQaKWp0m39qwOzHVBgAUBIXWj1pB+O2W3fIpNa6Y9KSKCVbfPhyAQ==", "requires": { "commander": "^8.3.0" } @@ -8832,12 +8832,12 @@ } }, "react-focus-lock": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/react-focus-lock/-/react-focus-lock-2.9.5.tgz", - "integrity": "sha512-h6vrdgUbsH2HeD5I7I3Cx1PPrmwGuKYICS+kB9m+32X/9xHRrAbxgvaBpG7BFBN9h3tO+C3qX1QAVESmi4CiIA==", + "version": "2.9.6", + "resolved": "https://registry.npmjs.org/react-focus-lock/-/react-focus-lock-2.9.6.tgz", + "integrity": "sha512-B7gYnCjHNrNYwY2juS71dHbf0+UpXXojt02svxybj8N5bxceAkzPChKEncHuratjUHkIFNCn06k2qj1DRlzTug==", "requires": { "@babel/runtime": "^7.0.0", - "focus-lock": "^0.11.6", + "focus-lock": "^1.0.0", "prop-types": "^15.6.2", "react-clientside-effect": "^1.2.6", "use-callback-ref": "^1.3.0", diff --git a/package.json b/package.json index 69c632fd..2248b8bb 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "prettier": "^2.1.2" }, "dependencies": { - "@oacore/design": "^4.9.49", + "@oacore/design": "^4.9.54", "@octokit/rest": "^18.5.0", "bootstrap": "^4.5.3", "camelize": "^1.0.0", diff --git a/pages/documentations/index.jsx b/pages/documentations/index.jsx new file mode 100644 index 00000000..3069aea3 --- /dev/null +++ b/pages/documentations/index.jsx @@ -0,0 +1,125 @@ +import React, { useState } from 'react' +import { Button } from '@oacore/design/lib/elements' +import { classNames } from '@oacore/design/lib/utils' + +import styles from './styles.module.scss' +import DocumentationPageTemplate from '../../templates/documentations' +import { Page } from '../../components' +import DataProviderDocs from '../../templates/documentations/dataProviderDocs' + +import text from 'data/membership.yml' +import retrieveContent from 'content' + +const ASSETS_BASE_URL = 'https://oacore.github.io/content/' + +const setAssetsUrl = (object) => + Object.entries(object).forEach(([, value]) => { + delete value.membership + if (value.images) { + Object.entries(value.images).forEach(([, item]) => { + item.file = ASSETS_BASE_URL + item.file + }) + } + }) + +const getSections = async ({ ref } = {}) => { + const content = await retrieveContent('docs-membership', { + ref, + transform: 'object', + }) + + delete content.headerDashboard + Object.values(content).forEach((section) => { + if (section.items) setAssetsUrl(section.items) + }) + return content +} + +const getProviderSections = async ({ ref } = {}) => { + const content = await retrieveContent('docs-dataProvider', { + ref, + transform: 'object', + }) + + Object.values(content).forEach((section) => { + if (section.items) setAssetsUrl(section.items) + }) + return content +} + +export async function getStaticProps({ previewData }) { + const ref = previewData?.ref + const sections = await getSections({ ref }) + const sectionProvider = await getProviderSections({ ref }) + const data = { + ...sections, + } + const dataProvider = { + ...sectionProvider, + } + + return { + props: { + data, + dataProvider, + }, + } +} + +const TABS = { + dataProvider: 'dataProvider', + membership: 'membership', +} + +const DocumentationPage = ({ data, dataProvider }) => { + const [activeTab, setActiveTab] = useState(TABS.dataProvider) + + const handleTabChange = (tab) => { + setActiveTab(tab) + } + + return ( + +
+
+ + +
+
+ {activeTab === TABS.dataProvider && ( + + )} + {activeTab === TABS.membership && } +
+ ) +} + +export default DocumentationPage diff --git a/pages/documentations/styles.module.scss b/pages/documentations/styles.module.scss new file mode 100644 index 00000000..7d579d38 --- /dev/null +++ b/pages/documentations/styles.module.scss @@ -0,0 +1,58 @@ +.tab-wrapper { + padding: 0 var(--page-padding-x); + .btn-wrapper { + padding: 3rem 0 1.5rem 0; + display: flex; + justify-content: center; + gap: 20px; + border-bottom: 2px solid #b75400; + .tab { + display: flex; + width: 50%; + font-size: 20px; + font-style: normal; + font-weight: 500; + line-height: 24px; + color: #000; + letter-spacing: 0.0015em; + cursor: pointer; + background: #f5f5f5; + filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)); + border-top-left-radius: 15px; + border-top-right-radius: 15px; + .tab-header { + color: #b75400; + font-size: 24px; + font-style: normal; + font-weight: 500; + line-height: 130%; + text-align: left; + margin-bottom: 14px; + text-transform: initial; + } + .tab-description { + color: #212121; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 20px; + letter-spacing: 0.04px; + text-align: left; + text-transform: initial; + } + .tab:last-child { + margin-left: 10px; + } + } + .active-tab { + color: #fff; + background: #b75400; + .tab-header { + color: #fff; + } + .tab-description { + color: #fff; + } + } + } +} diff --git a/pages/membership-documentation/index.jsx b/pages/membership-documentation/index.jsx deleted file mode 100644 index 3dc974b4..00000000 --- a/pages/membership-documentation/index.jsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react' - -import DocumentationPageTemplate from '../../templates/membership-documentation' -import { Page } from '../../components' - -import retrieveContent from 'content' - -const ASSETS_BASE_URL = 'https://oacore.github.io/content/' - -const setAssetsUrl = (object) => - Object.entries(object).forEach(([, value]) => { - delete value.membership - if (value.images) { - Object.entries(value.images).forEach(([, item]) => { - item.file = ASSETS_BASE_URL + item.file - }) - } - }) - -const getSections = async ({ ref } = {}) => { - const content = await retrieveContent('docs-membership', { - ref, - transform: 'object', - }) - - delete content.headerDashboard - Object.values(content).forEach((section) => { - if (section.items) setAssetsUrl(section.items) - }) - - return content -} - -export async function getStaticProps({ previewData }) { - const ref = previewData?.ref - const sections = await getSections({ ref }) - const data = { - ...sections, - } - - return { - props: { - data, - }, - } -} - -const DocumentationPage = ({ data }) => ( - - - -) - -export default DocumentationPage diff --git a/templates/documentations/dataProviderDocs.jsx b/templates/documentations/dataProviderDocs.jsx new file mode 100644 index 00000000..51ddf0b8 --- /dev/null +++ b/templates/documentations/dataProviderDocs.jsx @@ -0,0 +1,70 @@ +import React, { useEffect, useState } from 'react' +import { + DocumentationMembership, + DocumentationMembershipNav, +} from '@oacore/design/lib/modules' +import { useRouter } from 'next/router' + +import { Layout } from '../../design-v2/components' +import textData from '../../data/dataProviders.yml' +import styles from './styles.module.scss' + +function normalizeHref(str) { + const test = str.replace('#', '') + return test.replace('_', '-') +} +const DataProviderDocs = ({ items }) => { + const [highlight, setHighlight] = useState() + const [navActiveIndex, setNavActiveIndex] = useState(null) + const route = useRouter() + const headerHeight = 56 + + useEffect(() => { + const { hash } = window.location + const id = hash.substring(1) + const element = document.getElementById(id) + setTimeout(() => { + if (element) { + const rect = element.getBoundingClientRect() + window.scrollTo({ + top: rect.top + window.scrollY - headerHeight, + behavior: 'smooth', + block: 'center', + }) + const n = items?.items?.findIndex((item) => item.id === id) + setHighlight(n) + } + }, 100) + }, [route.asPath]) + + useEffect(() => { + const id = route.query?.r + if (id) { + const n = textData.navItems.findIndex( + (item) => normalizeHref(item.href) === id + ) + setNavActiveIndex(n) + } + }, []) + + return ( + + + } + /> + + ) +} + +export default DataProviderDocs diff --git a/templates/membership-documentation/index.jsx b/templates/documentations/index.jsx similarity index 94% rename from templates/membership-documentation/index.jsx rename to templates/documentations/index.jsx index cd63d831..3c90d4a0 100644 --- a/templates/membership-documentation/index.jsx +++ b/templates/documentations/index.jsx @@ -8,6 +8,7 @@ import { useRouter } from 'next/router' import Markdown from '../../components/markdown' import { Layout } from '../../design-v2/components' import textData from '../../data/membership.yml' +import styles from './styles.module.scss' function normalizeHref(str) { const test = str.replace('#', '') @@ -47,12 +48,13 @@ const DocumentationPageTemplate = ({ headerAbout, docs }) => { setNavActiveIndex(n) } }, []) + return ( - + {headerAbout.header.caption}} - docs={docs} + docs={docs?.items} highlight={highlight} setHighlight={setHighlight} nav={ diff --git a/templates/membership-documentation/styles.module.scss b/templates/documentations/styles.module.scss similarity index 93% rename from templates/membership-documentation/styles.module.scss rename to templates/documentations/styles.module.scss index 3f084b92..96d5fd41 100644 --- a/templates/membership-documentation/styles.module.scss +++ b/templates/documentations/styles.module.scss @@ -1,9 +1,13 @@ +.docs-layout { + padding: 9px var(--page-padding-x); +} + .documentation-wrapper { margin: 15px 0; } .documentation-inner-wrapper { - width: calc(100vw - 370px); + width: calc(100% - 370px); overflow-y: scroll; } @@ -37,6 +41,7 @@ border-bottom: 2px dashed #eee; p { margin-top: 24px; + line-height: 24px; } }