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

[i18nIgnore] Migrate to Content Collections #2546

Merged
merged 101 commits into from
Feb 15, 2023
Merged

[i18nIgnore] Migrate to Content Collections #2546

merged 101 commits into from
Feb 15, 2023

Conversation

bholmesdev
Copy link
Contributor

@bholmesdev bholmesdev commented Feb 2, 2023

What kind of changes does this PR include?

  • Changes to the docs site code

Description

  • Migrate all docs pages to a docs collection under /src/content/docs/. This preserves the existing i18n folder structure, unchanged.
  • Enforce schemas for different docs layouts based on a new type frontmatter param. This type replaces the layout param, and can be omitted when using the MainLayout. These types can be found browsing the schemas under src/content/config.ts. I'm curious if the docs team has ideas for CONTRIBUTING updates or further refactors here!
---
- layout: ~/layouts/DeployGuideLayout.astro
+ type: deploy
---
  • Update navigation mappers, open graph utilities, and other uses of glob to use getCollection.
  • Update the [lang]/[...slug].astro to render content collection entries. This also allowed for fallbacks and page routes to be generated in the same place. This also maps the type frontmatter param to the correct layout.
  • Add type safety to layout and head props.
  • Add a new splitSlugFromLang util. This helps with parsing the language out of the generated content collection slug.
  • Rename redirect slug routes to [...enRedirectSlug] and [enBaseLevelRedirectSlug]. This was purely for readability debugging our new slug generation routes. I'll differ to @delucis for changing this naming back.

Chores

  • Bump Astro core to 2.0, and peer packages to their respective majors
  • Update markdown config to use new gfm and smartypants flags

@netlify
Copy link

netlify bot commented Feb 2, 2023

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 3f59d05
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/63ed18f81ac0510009b5293c
😎 Deploy Preview https://deploy-preview-2546--astro-docs-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 settings.

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Feb 2, 2023
@sarah11918
Copy link
Member

Confirming that I have tested/looked for (large screen size):
Tutorial: check boxes, multiple choice quizzes, confetti
Components: package manager tabs (including selecting one affecting all on the page), Since (new added in), Right sidebar tracking
Alt Layouts: tutorial, deploy, migrate, CMS
Different languages: navigated in pl and pt-Br

@yanthomasdev
Copy link
Member

I had checked this PR before the optimizations and everything was working properly, and again I'm here to confirm everything looks great!

What I tested:

  • Are components working? (Since, Badge, Version, Tabs, Algolia, Dev-only warning, etc) ✔️
  • Are all pages and their subpages being rendered? (Integrations, Error Reference, 404...) ✔️
  • Are our translations there, working as intended? (Language Selector, Fallback, "EN", etc) ✔️
  • No layout bugs or malfunctioning mobile features? ✔️

@sarah11918
Copy link
Member

is updating our contributor/translator guide a pre-req to merging this? Should we have that available first, @delucis @Yan-Thomas ?

@yanthomasdev
Copy link
Member

is updating our contributor/translator guide a pre-req to merging this? Should we have that available first, @delucis @Yan-Thomas ?

I believe @delucis made all the necessary changes to these, couldn't find anywhere else in our .md guides where we mention src/pages rather than src/content, so we should be good to go!

@sarah11918
Copy link
Member

DOES THIS MEAN I APPROVE????

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

I have not found any reason not to approve this...

Great work @delucis & @bholmesdev !

Let's ... NOT do this again soon?? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 action i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants