Skip to content

Commit

Permalink
Merge pull request #12 from RENCI/test/frontmatter
Browse files Browse the repository at this point in the history
Test/frontmatter
  • Loading branch information
suejinkim20 authored Jul 15, 2024
2 parents 27bd12b + b1eb6d6 commit 5afe628
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 28 deletions.
8 changes: 0 additions & 8 deletions next.config.js

This file was deleted.

18 changes: 18 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import nextMdx from '@next/mdx'
import remarkFrontmatter from 'remark-frontmatter';
import remarkMdxFrontmatter from 'remark-mdx-frontmatter';

const withMdx = nextMdx({
extension: /\.mdx?$/,
options: {
jsx: true,
remarkPlugins: [remarkFrontmatter, [remarkMdxFrontmatter, { name: 'frontmatter' }]],
rehypePlugins: []
},
})

export default withMdx({
output: 'export',
basePath: process.env.BASE_PATH ?? '',
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx']
})
123 changes: 123 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.44.3",
"remark-frontmatter": "^5.0.0",
"remark-mdx-frontmatter": "^5.0.0",
"typescript": "5.0.4"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { Section } from "@/components/Section/Section";
import { DataIcon } from "@/components/icons/DataIcon";
import { QueryIcon } from "@/components/icons/QueryIcon";
import Resources from '../content/resources.mdx'
import { tools } from '../content/tools.mdx'
import { frontmatter as tools } from '../content/tools.mdx'
import Funding from '../content/funding.mdx'
import License from '../content/license.mdx'
import Events from '../content/events.mdx'

interface Tool {
interface Tools {
title: string;
link: string;
description: string;
Expand Down
41 changes: 23 additions & 18 deletions src/content/tools.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
export const tools = [
{
title: "ROBOKOP KG",
link: "http://robokopkg.renci.org/",
description: "ROBOKOP KG is an open-source biomedical knowledge graph containing ~10M nodes and ~250M edges drawn from ~30 biological data sources and bio-ontologies. Query the ROBOKOP KG directly in the Neo4j browser."
},
{
title: "ExEmPLAR",
link: "https://www.exemplar.mml.unc.edu/",
warning: "ExEmplar is under development and should be considered an experimental alternative to the ROBOKOP UI.",
description: "ExEmplar is a generic Neo4j query-and-answer exploration tool that supports queries of the ROBOKOP KG and other Neo4j databases."
},
{
title: "RoboDocumentation",
link: "https://github.com/RobokopU24/RoboDocumentation/",
description: "A collection of notebooks and other documents to help users get the most out of ROBOKOP."
}
]
---
- title: "ROBOKOP KG"
link: "http://robokopkg.renci.org/"
description: >
ROBOKOP KG is an open-source biomedical knowledge graph
containing ~10M nodes and ~250M edges drawn from ~30
biological data sources and bio-ontologies. Query the
ROBOKOP KG directly in the Neo4j browser.
- title: "ExEmPLAR"
link: "https://www.exemplar.mml.unc.edu/"
warning: >
ExEmplar is under development and should be considered an
experimental alternative to the ROBOKOP UI.
description: >
ExEmplar is a generic Neo4j query-and-answer exploration
tool that supports queries of the ROBOKOP KG and other
Neo4j databases.
- title: "RoboDocumentation"
link: "https://github.com/RobokopU24/RoboDocumentation/"
description: >
A collection of notebooks and other documents to help
users get the most out of ROBOKOP.
---
7 changes: 7 additions & 0 deletions src/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
...components,
}
}

declare module '*.mdx' {
// This is the export key for the frontmatter (defined in the next.config.mjs file)
// If the shape of the frontmatter gets more complex, we can define a better type
// here or use a runtime validator like zod.
export const frontmatter: any;
}

0 comments on commit 5afe628

Please sign in to comment.