-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remote Substreams docs #346
Conversation
const rawMdx = `--- | ||
title: ${t('index.title')} | ||
--- | ||
|
||
${t('index.intro')} | ||
|
||
<Intro /> | ||
|
||
## ${t('index.networkRoles.title')} | ||
|
||
${t('index.networkRoles.description')} | ||
|
||
<NetworkRoles /> | ||
|
||
## ${t('index.products.title')} | ||
|
||
<Products /> | ||
|
||
## ${t('index.supportedNetworks.title')} | ||
|
||
${t('index.supportedNetworks.description')} | ||
|
||
<SupportedNetworks />` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks pretty, + we avoid ugly code to inject frontmatter and headings for TOC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is great!
website/components/_app.tsx
Outdated
) | ||
return pageMap | ||
}, [__nextra_internal__.pageMap, hasMDXPage, locale]) | ||
const localeSwitcher = <LocaleSwitcher key="localeSwitcher" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can avoid useMemo and just render component outside function declaration
This comment was marked as duplicate.
This comment was marked as duplicate.
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"sharp": "^0.32.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was marked as resolved.
This comment was marked as resolved.
const banner = ` | ||
import { getPageMap } from '@/components/get-page-map' | ||
|
||
export const getStaticProps = async context => ({ | ||
props: { | ||
__nextra_pageMap: await getPageMap('${route.split('/')[1]}') | ||
} | ||
})` | ||
result += banner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does banner
mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the piece of code to include getStaticProps
for pages that don't have it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is cool!
() => (tree, _file, done) => { | ||
const GITBOOK_CALLOUT_REGEX = /{%.*?%}/ | ||
visit(tree, 'paragraph', (node) => { | ||
for (const child of node.children) { | ||
if (child.value) { | ||
child.value = child.value.replace(GITBOOK_CALLOUT_REGEX, '') | ||
} | ||
} | ||
}) | ||
done() | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these "callouts" that you're removing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this https://docs.gitbook.com/content-creation/blocks/hint#git-sync-representation-in-markdown
Note: I remove only
callout tags
not the callout itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Looks like the substreams docs are only available in English at the moment, and they cannot be translated through Crowdin because they are not in this repo. Do we have any plans for that?
either setup another source for crowdin Input: Output: or just download raw But if we do it we don't need even Remote MDX since all Substreams docs will be restored inside this repo |
@B2o5T – Something else that I noticed: the substreams pages don't set the current page's title in the |
* Hide locale switcher on `/en/substreams` pages * Trailing slashes are important, apparently
_app.tsx
pages/[locale]/index.mdx
(use better approach than proposed in Simplify_app.tsx
#344)