-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
feat: showcase #9967
base: main
Are you sure you want to change the base?
feat: showcase #9967
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: +4.94 kB (+0.29%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
Been trying to process markdown showcase page however I don't understand the logic looking at plugin page, return {
type: 'mdx',
permalink,
source: aliasedSourcePath,
title: frontMatter.title ?? contentTitle,
description: frontMatter.description ?? excerpt,
frontMatter,
unlisted,
}; and await Promise.all(
content.map(async (metadata) => {
const {permalink, source} = metadata;
const routeMetadata = createPageRouteMetadata(metadata);
if (metadata.type === 'mdx') {
await createData( // ozaki: why dont we store this value in a const and then pass it to addRoute modules.content ?
// Note that this created data path must be in sync with
// metadataPath provided to mdx-loader.
`${docuHash(metadata.source)}.json`,
JSON.stringify(metadata, null, 2),
);
addRoute({
path: permalink,
component: options.mdxPageComponent, // ozaki: how does the content is rendered in the component ?
exact: true,
metadata: routeMetadata,
modules: {
content: source, // ozaki: how does the content is a aliasedPath ?
},
});
} else {
// process things that are not mdx
}
}),
);
``` |
Trying to implement image insertion, let's say we have this file structure :
I wonder how to resolve the image path when rendering to the component, I've made it work with the assets folder but I think its better to let preview images aside .yml files |
Co-authored-by: Sébastien Lorber <[email protected]>
const Tags = useShowcaseTags(); | ||
const TagList = Object.keys(Tags) as TagType[]; | ||
|
||
const tagObjects = tags.map((tag) => ({tag, ...Tags[tag]})); | ||
|
||
// Keep same order for all tags | ||
const tagObjectsSorted = sortBy(tagObjects, (tagObject) => | ||
TagList.indexOf(tagObject.tag), | ||
); |
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 plugin should probably short the site tags on the nodejs side, this way the theme receives already-sorted tags and we don't need to run any extra runtime logic
Pre-flight checklist
Motivation
Test Plan
Test links
Deploy preview & tests
showcaseAll
Related issues/PRs
#6882