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(content-blog): make post ID unique #6061

Merged
merged 2 commits into from
Dec 8, 2021
Merged

fix(content-blog): make post ID unique #6061

merged 2 commits into from
Dec 8, 2021

Conversation

Josh-Cena
Copy link
Collaborator

Breaking change

The blog posts' ID may have changed. Previously, they represented neither the slug nor the title: it was a weird mix of the two, which makes it pretty useless for rendering. Moreover, we discovered that this ID generation is not guaranteed to be unique either. Now, we have normalized all IDs into the posts' slugs. If you relied on the whacky IDs before in your swizzled component, consider using either metadata.title or slug instead.

Motivation

Fix #6059

Test plans

Added two dogfooding posts

@Josh-Cena Josh-Cena added pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: bug fix This PR fixes a bug in a past release. labels Dec 7, 2021
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 7, 2021
@@ -13,14 +13,14 @@ exports[`blogFeed atom shows feed item for each post 1`] = `
<rights>Copyright</rights>
<entry>
<title type=\\"html\\"><![CDATA[MDX Blog Sample with require calls]]></title>
<id>MDX Blog Sample with require calls</id>
<id>/mdx-require-blog-post</id>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you be wondering: the id field doesn't really matter for the feeds. The example of the library itself uses post.url as the ID.

@netlify
Copy link

netlify bot commented Dec 7, 2021

✔️ [V2]

🔨 Explore the source changes: 209fd5f

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61af48c1aa156b0008053238

😎 Browse the preview: https://deploy-preview-6061--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 94
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-6061--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Dec 7, 2021

Size Change: +1.22 kB (0%)

Total Size: 657 kB

Filename Size Change
website/build/assets/js/main.********.js 486 kB +1.22 kB (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 40.1 kB
website/build/assets/css/styles.********.css 101 kB
website/build/index.html 29.5 kB

compressed-size-action

@Josh-Cena Josh-Cena added status: awaiting review This PR is ready for review, will be merged after maintainers' approval and removed status: awaiting review This PR is ready for review, will be merged after maintainers' approval labels Dec 7, 2021
@Josh-Cena Josh-Cena merged commit 8644097 into main Dec 8, 2021
@Josh-Cena Josh-Cena deleted the jc/post-id branch December 8, 2021 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blog entries with duplicate title doesn't get published on the blog index page
2 participants