-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add GPT Homepage and Details Page (#157)
* feat: add GPT homepage * feat: add GPT Details Page with temp links * chore: update .gitignore to ignore pulled in gpt pages * chore: update links to redirect to the janus-idp repo * chore: updated the gpts to display on the community site * Co-authored-by: Frank Kong <Zaperex@users.noreply.github.com> * chore: update tsconfig.json in apps/website * chore: temporarily remove tsc from ci * chore: remove unused gpt searchbar * chore: remove null return type for searchbar --------- Co-authored-by: Paul Schultz <pschultz@pobox.com> Co-authored-by: Frank Kong <Zaperex@users.noreply.github.com>
- Loading branch information
1 parent
26ccd69
commit adeee6e
Showing
26 changed files
with
816 additions
and
349 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -31,3 +31,6 @@ yarn-error.log* | |
|
||
# turbo | ||
.turbo | ||
|
||
# vscode | ||
.vscode |
This file contains 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 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 |
---|---|---|
|
@@ -21,3 +21,5 @@ yarn-error.log* | |
|
||
/src/pages/plugins | ||
!/src/pages/plugins.tsx | ||
/src/pages/gpts | ||
!/src/pages/gpts.tsx |
This file contains 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,93 @@ | ||
/** | ||
* Copyright 2023 Janus Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** @type {import('ui/types').GPT[]} */ | ||
const GPT_LIST = [ | ||
{ | ||
title: 'Ansible Job', | ||
description: 'Launch an Ansible Job within Ansible Automation Platform', | ||
href: 'gpts/ansible-job', | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/ansible-job/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/ansible-job', | ||
}, | ||
{ | ||
title: 'Add ArgoCD to an existing project', | ||
description: 'Add ArgoCD to an existing project', | ||
href: 'gpts/argocd', | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/argocd-template/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/argocd-template', | ||
}, | ||
{ | ||
title: '.NET Frontend application', | ||
description: 'Create a starter .NET frontend application with a CI pipeline', | ||
href: 'gpts/dotnet-frontend', | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/dotnet-frontend-template/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/dotnet-frontend-template', | ||
}, | ||
{ | ||
title: 'Go Backend application', | ||
description: 'Create a starter Go backend application with a CI pipeline', | ||
href: 'gpts/go-backend', | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/go-backend-template/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/go-backend-template', | ||
}, | ||
{ | ||
title: 'Node.js Backend application', | ||
description: 'Create a starter Node.js backend application with a CI pipeline', | ||
href: 'gpts/nodejs-backend', | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/nodejs-backend-template/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/nodejs-backend-template', | ||
}, | ||
{ | ||
title: 'Python Backend application', | ||
description: 'Create a starter Python backend application with a CI pipeline', | ||
href: 'gpts/python-backend', | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/python-backend-template/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/python-backend-template', | ||
}, | ||
{ | ||
title: 'Quarkus Backend application', | ||
description: 'Create a starter Quarkus Backend application with a CI pipeline', | ||
href: `gpts/quarkus-backend`, | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/quarkus-backend-template/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/quarkus-backend-template', | ||
}, | ||
{ | ||
title: 'Spring Boot Backend application', | ||
description: 'Create a starter Spring Boot backend application with a CI pipeline', | ||
href: 'gpts/spring-boot-backend', | ||
githubUrl: | ||
'https://raw.githubusercontent.com/janus-idp/software-templates/main/scaffolder-templates/spring-boot-backend-template/README.md', | ||
sourceUrl: | ||
'https://github.com/janus-idp/software-templates/tree/main/scaffolder-templates/spring-boot-backend-template', | ||
}, | ||
]; | ||
|
||
module.exports = { GPT_LIST }; |
This file contains 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 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 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,61 @@ | ||
/** | ||
* Copyright 2023 Janus Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
const linkRegex = /!\[([\w .-]+)]\(\.\/([\w ./-]+)\)/gm; | ||
|
||
/** | ||
* @param {import('ui/types').RemoteContent[]} remoteContent | ||
* @param {string} component | ||
* | ||
* @returns {import('ui/types').DocusaurusRemoteContent[]} | ||
*/ | ||
function fetchRemoteContent(remoteContent, component) { | ||
return remoteContent.map((plugin) => { | ||
const filenameIndex = plugin.githubUrl.lastIndexOf('/') + 1; | ||
const sourceBaseUrl = plugin.githubUrl.slice(0, Math.max(0, filenameIndex)); | ||
const filename = plugin.githubUrl.slice(Math.max(0, filenameIndex)); | ||
|
||
return [ | ||
'docusaurus-plugin-remote-content', | ||
{ | ||
name: `${plugin.title}-content`, | ||
sourceBaseUrl, | ||
outDir: `src/pages/${plugin.href}`, | ||
documents: [filename], | ||
modifyContent: (fname, content) => { | ||
if (fname.includes('README')) { | ||
return { | ||
filename: 'index.mdx', | ||
content: `--- | ||
title: ${plugin.title} | ||
description: ${plugin.description} | ||
--- | ||
import { ${component} } from 'ui/components'; | ||
<${component} remoteContent={{${Object.entries(plugin) | ||
.map(([key, value]) => `${key}:"${value}"`) | ||
.join(',')}}} /> | ||
${content.replaceAll(linkRegex, `![$1](${sourceBaseUrl}$2)`)}`, | ||
}; | ||
} | ||
}, | ||
}, | ||
]; | ||
}); | ||
} | ||
|
||
module.exports = { fetchRemoteContent }; |
This file contains 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,59 @@ | ||
/** | ||
* Copyright 2023 Janus Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import Link from '@docusaurus/Link'; | ||
import { GPT_LIST } from '@site/content/gpts-list'; | ||
import Layout from '@theme/Layout'; | ||
import Fuse from 'fuse.js'; | ||
import React from 'react'; | ||
import { GPTsGrid } from 'ui/components'; | ||
import { GPT } from 'ui/types'; | ||
|
||
const GPT_FUSE = new Fuse(GPT_LIST as GPT[], { | ||
threshold: 0.25, | ||
ignoreLocation: true, | ||
keys: [{ name: 'title', weight: 2 }, 'description'], | ||
}); | ||
|
||
function GPTsHeader(): JSX.Element { | ||
return ( | ||
<header className="hero hero--primary relative overflow-hidden px-0 py-16 text-center"> | ||
<div className="container"> | ||
<h1 className="hero__title">Janus Golden Path Templates</h1> | ||
<p className="hero__subtitle">Have a GPT idea?</p> | ||
<div className="flex items-center justify-center"> | ||
<Link | ||
className="button button--secondary button--lg" | ||
to="https://github.com/janus-idp/software-templates/issues/new?assignees=&labels=template&projects=&template=gpts.yaml&title=GPT%3A+" | ||
> | ||
Submit a proposal for a GPT! | ||
</Link> | ||
</div> | ||
</div> | ||
</header> | ||
); | ||
} | ||
|
||
export default function Plugins(): JSX.Element { | ||
return ( | ||
<Layout title="GPTs" description="Description will go into a meta tag in <head />"> | ||
<GPTsHeader /> | ||
<main> | ||
<GPTsGrid GPT_FUSE={GPT_FUSE} GPT_LIST={GPT_LIST as GPT[]} /> | ||
</main> | ||
</Layout> | ||
); | ||
} |
Oops, something went wrong.