Skip to content
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

Draft
wants to merge 79 commits into
base: main
Choose a base branch
from
Draft

feat: showcase #9967

wants to merge 79 commits into from

Conversation

OzakIOne
Copy link
Collaborator

@OzakIOne OzakIOne commented Mar 20, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Test Plan

  • add tests
    • add more test and cover more cases

Test links

Deploy preview & tests

showcaseAll

Related issues/PRs

#6882

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 20, 2024
Copy link

netlify bot commented Mar 20, 2024

[V2]

Name Link
🔨 Latest commit 38a71a6
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/662044b779043500083ae82f
😎 Deploy Preview https://deploy-preview-9967--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Mar 20, 2024

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 64 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 60 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 76 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 67 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 63 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 67 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 77 🟢 100 🟢 100 🟢 90 🟠 88 Report

Copy link

github-actions bot commented Mar 20, 2024

Size Change: +3.32 kB (0%)

Total Size: 1.59 MB

Filename Size Change
website/.docusaurus/docusaurus.config.mjs 26.8 kB +95 B (0%)
website/.docusaurus/registry.js 248 kB +771 B (0%)
website/.docusaurus/routes.js 156 kB +107 B (0%)
website/.docusaurus/routesChunkNames.json 109 kB +134 B (0%)
website/.docusaurus/site-metadata.json 2.33 kB +154 B (+7%) 🔍
website/build/assets/css/styles.********.css 114 kB +1.36 kB (+1%)
website/build/assets/js/main.********.js 808 kB +704 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/codeTranslations.json 2 B 0 B
website/.docusaurus/globalData.json 91.2 kB 0 B
website/.docusaurus/i18n.json 930 B 0 B
website/build/index.html 38 kB +1 B (0%)

compressed-size-action

@OzakIOne
Copy link
Collaborator Author

Been trying to process markdown showcase page however I don't understand the logic looking at plugin page,
loadContent returns

return {
	type: 'mdx',
	permalink,
	source: aliasedSourcePath,
	title: frontMatter.title ?? contentTitle,
	description: frontMatter.description ?? excerpt,
	frontMatter,
	unlisted,
};

and contentLoaded does this :

      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
          }
        }),
      );
      ```

@OzakIOne
Copy link
Collaborator Author

Trying to implement image insertion, let's say we have this file structure :

website/
	src/
		showcase/
			site/
				site.yml
				preview.jpg

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

packages/docusaurus-plugin-showcase/README.md Outdated Show resolved Hide resolved
packages/docusaurus-plugin-showcase/package.json Outdated Show resolved Hide resolved
packages/docusaurus-plugin-showcase/src/options.ts Outdated Show resolved Hide resolved
packages/docusaurus-plugin-showcase/src/options.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants