Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: showcase#9967

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
OzakIOne wants to merge87 commits intomain
base:main
Choose a base branch
Loading
fromozaki/showcase
Draft

feat: showcase#9967

OzakIOne wants to merge87 commits intomainfromozaki/showcase

Conversation

@OzakIOne
Copy link
Contributor

@OzakIOneOzakIOne commentedMar 20, 2024
edited
Loading

Pre-flight checklist

  • I have read theContributing 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

  • a page per site
    • a site = 1 yaml or markdown file in a folder for images
      • add support for linking local images
  • file tags.yaml
  • custom attributes in yaml / frontmatter
  • good plugin code / file structure (take example on docs/blog)
  • pluginId ?
  • i18n support
  • mergehttps://github.com/facebook/docusaurus/tree/ozaki/showcaseSites

Test Plan

  • add tests
    • add more test and cover more cases

Test links

Deploy preview & tests

showcaseAll

Related issues/PRs

#6882

glibg10b reacted with heart emoji
@facebook-github-botfacebook-github-bot added the CLA SignedSigned Facebook CLA labelMar 20, 2024
@netlify
Copy link

netlifybot commentedMar 20, 2024
edited
Loading

[V2]

NameLink
🔨 Latest commitdee675c
🔍 Latest deploy loghttps://app.netlify.com/sites/docusaurus-2/deploys/6645e8f7173b9900088acec4
😎 Deploy Previewhttps://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 yourNetlify site configuration.

@github-actions
Copy link

github-actionsbot commentedMar 20, 2024
edited
Loading

⚡️ Lighthouse report for the deploy preview of this PR

URLPerformanceAccessibilityBest PracticesSEOPWAReport
/🟠 68🟢 98🟢 96🟢 100🟠 88Report
/docs/installation🟠 57🟢 96🟢 100🟢 100🟠 88Report
/docs/category/getting-started🟠 76🟢 100🟢 100🟢 90🟠 88Report
/blog🟠 66🟢 100🟢 100🟢 90🟠 88Report
/blog/preparing-your-site-for-docusaurus-v3🟠 63🟢 96🟢 100🟢 100🟠 88Report
/blog/tags/release🟠 70🟢 100🟢 100🟠 80🟠 88Report
/blog/tags🟠 75🟢 100🟢 100🟢 90🟠 88Report

@github-actions
Copy link

github-actionsbot commentedMar 20, 2024
edited
Loading

Size Change: +4.94 kB (+0.29%)

Total Size: 1.72 MB

FilenameSizeChange
website/.docusaurus/docusaurus.config.mjs27 kB+95 B (+0.35%)
website/.docusaurus/globalData.json107 kB+203 B (+0.19%)
website/.docusaurus/registry.js277 kB+1.14 kB (+0.41%)
website/.docusaurus/routes.js179 kB+398 B (+0.22%)
website/.docusaurus/routesChunkNames.json120 kB+290 B (+0.24%)
website/.docusaurus/site-metadata.json2.33 kB+154 B (+7.09%)🔍
website/build/assets/css/styles.********.css114 kB+1.36 kB (+1.21%)
website/build/assets/js/main.********.js855 kB+1.3 kB (+0.15%)
ℹ️View Unchanged
FilenameSizeChange
website/.docusaurus/codeTranslations.json2 B0 B
website/.docusaurus/i18n.json930 B0 B
website/build/index.html38.1 kB+1 B (0%)

compressed-size-action

@OzakIOne
Copy link
ContributorAuthor

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

andcontentLoaded does this :

awaitPromise.all(content.map(async(metadata)=>{const{permalink, source}=metadata;constrouteMetadata=createPageRouteMetadata(metadata);if(metadata.type==='mdx'){awaitcreateData(// 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
ContributorAuthor

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

website/src/showcase/site/site.ymlpreview.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

Comment on lines +44 to +52
constTags=useShowcaseTags();
constTagList=Object.keys(Tags)asTagType[];

consttagObjects=tags.map((tag)=>({tag, ...Tags[tag]}));

// Keep same order for all tags
consttagObjectsSorted=sortBy(tagObjects,(tagObject)=>
TagList.indexOf(tagObject.tag),
);
Copy link
Collaborator

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@slorberslorberslorber requested changes

@Josh-CenaJosh-CenaAwaiting requested review from Josh-CenaJosh-Cena will be requested when the pull request is marked ready for reviewJosh-Cena is a code owner

Assignees

No one assigned

Labels

CLA SignedSigned Facebook CLA

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@OzakIOne@slorber@facebook-github-bot

[8]ページ先頭

©2009-2025 Movatter.jp