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

fix(plugin-typedoc): link error and empty dir labels in sidebar #1628

Merged
merged 4 commits into from
Nov 28, 2024

Conversation

SoonIter
Copy link
Member

@SoonIter SoonIter commented Nov 26, 2024

Summary

  1. fix the link jump error (only exist in mdxRs: true)
  2. fix the dir empty labels (caused by index convention refactor)
        function getDirLabelName(): string {
          let dirName;

          if (
            typeof label === 'string' &&
            label.startsWith(DEFAULT_DIRNAME_PREFIX)
          ) {
            dirName = label.replace(DEFAULT_DIRNAME_PREFIX, '');
          }

          // 1. { "label": "DIR", type: "dir" } in _meta.json
          if (!dirName && label) {
            return label;
          }
          // 2. H1 or frontmatter title in md
          if (title) {
            return title;
          }
          // 3. fallback to fs dirname
          return dirName ?? '';
        }
  1. refactor plugin-typedoc, generate sidebar with _meta.json

Related Issue

closes #1603
closes #1629

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for aquamarine-blini-95325f ready!

Name Link
🔨 Latest commit 5b9825e
🔍 Latest deploy log https://app.netlify.com/sites/aquamarine-blini-95325f/deploys/6747ede940d56e00089d8c82
😎 Deploy Preview https://deploy-preview-1628--aquamarine-blini-95325f.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 81 (🔴 down 13 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

@SoonIter SoonIter changed the title fix(plugin-typedoc): fix the typedoc fix(plugin-typedoc): link error and empty dir labels in sidebar Nov 26, 2024
@Timeless0911 Timeless0911 merged commit 173ed3f into main Nov 28, 2024
8 checks passed
@Timeless0911 Timeless0911 deleted the chore/fix-typedoc branch November 28, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants