Skip to content

Commit

Permalink
add spacex example and remove faunadb example (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelletier197 authored Mar 31, 2024
1 parent 5c0a9a5 commit 022bcd5
Show file tree
Hide file tree
Showing 14 changed files with 2,249 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:

- name: Generate Examples
run: |
cd packages/examples/fauna
cd packages/examples/spacex
pnpm install --global @magidoc/cli@latest
magidoc generate
- name: Publish
run: |
cd packages/examples/fauna
cd packages/examples/spacex
npx netlify-cli@latest deploy --prod --dir "./docs"
env:
NETLIFY_SITE_ID: ${{ secrets.CARBON_MULTI_PAGE_SITE_ID }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See the [quickstart guide](https://magidoc.js.org/introduction/quickstart).

## Demo

👉 See the [demo website](https://magidoc-carbon-multi-page.netlify.app) generated from FaunaDB's example [GraphQL API](https://fauna.com/blog/try-faunadbs-graphql-api).
👉 See the [demo website](https://magidoc-carbon-multi-page.netlify.app) generated from SpaceX's public [GraphQL API](https://spacex-production.up.railway.app/).

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/02.Cli/01.Magidoc Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default {
* For instance, this can be used to customize the application icon.
* Inside your directory, put a file named `logo.png`, and as the `appLogo` website setting, use "/logo.png" as the URL for the image.
*
* @see https://github.com/magidoc-org/magidoc/blob/main/packages/examples/fauna/magidoc.mjs for an example.
* @see https://github.com/magidoc-org/magidoc/blob/main/packages/examples/spacex/magidoc.mjs for an example.
* @default undefined
*/
staticAssets: 'path/to/a/directory',
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/03.Templates/02.Carbon-multi-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See the template's [readme](https://github.com/magidoc-org/magidoc/blob/main/pac

## Demo

See the latest example of this template on [Netlify](https://magidoc-carbon-multi-page.netlify.app), along with its [configuration file](https://github.com/magidoc-org/magidoc/blob/main/packages/examples/fauna/magidoc.mjs).
See the latest example of this template on [Netlify](https://magidoc-carbon-multi-page.netlify.app), along with its [configuration file](https://github.com/magidoc-org/magidoc/blob/main/packages/examples/spacex/magidoc.mjs).

## Supported options

Expand Down
Binary file removed packages/examples/fauna/assets/favicon.png
Binary file not shown.
Binary file removed packages/examples/fauna/assets/logo.png
Binary file not shown.
10 changes: 0 additions & 10 deletions packages/examples/fauna/pages/01.Welcome.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/examples/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ignore-workspace-root-check: true
packages:
- "fauna"
- "spacex"
- "multi-schema"
2 changes: 1 addition & 1 deletion packages/examples/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This directory contains various examples of Magidoc usage.

## Examples
- [FaunaDB](./fauna) shows how to generate a basic website, based on a public FaunaDB GraphQL API example. It is the template used to generate Magidoc's [demo website](https://magidoc-carbon-multi-page.netlify.app/welcome).
- [SpaceX](./spacex) shows how to generate a basic website, based on a public SpaceX GraphQL API example. It is the template used to generate Magidoc's [demo website](https://magidoc-carbon-multi-page.netlify.app/welcome).
- [Multi-Schema] shows how you can generate a Magidoc website for multiple different GraphQL schemas and how you can link those together into one common website.
Binary file added packages/examples/spacex/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/examples/spacex/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,29 @@ function relativePath(target) {
export default {
introspection: {
type: 'url',
url: 'https://graphql.fauna.com/graphql',
headers: {
// https://fauna.com/blog/try-faunadbs-graphql-api
// Those are public credentials
Authorization: `Basic Zm5BRFFVdWNRb0FDQ1VpZDAxeXVIdWt2SnptaVY4STI4a2R6Y0p2UDo=`,
},
url: 'https://spacex-production.up.railway.app/graphql',
},
website: {
template: 'carbon-multi-page',
staticAssets: relativePath('./assets'),
options: {
appTitle: 'FaunaDB',
appTitle: 'SpaceX GraphQL API',
appLogo: '/logo.png',
appFavicon: '/favicon.png',
siteMeta: {
description: "Magidoc demo for FaunaDB's GraphQL API.",
'og:description': "Magidoc demo for FaunaDB's GraphQL API.",
description: "Magidoc demo for SpaceX's GraphQL API.",
'og:description': "Magidoc demo for SpaceX's GraphQL API.",
},
pages: [
{
title: 'Welcome',
content: markdown`
# 👋 Hi
Welcome to [FaunaDB](https://fauna.com/blog/try-faunadbs-graphql-api)'s GraphQL documentation
Welcome to [SpaceX](https://studio.apollographql.com/public/SpaceX-pxxbxen/variant/current/explorer)'s GraphQL documentation
generated with [Magidoc](https://github.com/magidoc-org/magidoc), a free open source software designed to build customizable static GraphQL documentation websites with little effort.
You wonder how easy it was to build this website? Have a look at the [configuration file](https://github.com/magidoc-org/magidoc/blob/main/packages/examples/fauna/magidoc.mjs).
You wonder how easy it was to build this website? Have a look at the [configuration file](https://github.com/magidoc-org/magidoc/blob/main/packages/examples/spacex/magidoc.mjs).
## Wanna learn more?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@magidoc/example-faundb",
"name": "@magidoc/example-spacex",
"version": "1.0.0",
"description": "This is an example of documentation for a GraphQL schema.",
"scripts": {
Expand Down
Loading

0 comments on commit 022bcd5

Please sign in to comment.