docs icon indicating copy to clipboard operation
docs copied to clipboard

split API reference into modules

Open sarah11918 opened this issue 1 year ago β€’ 6 comments

Description (required)

In an attempt to make the API reference easier to navigate adds a new reference section specifically for the Astro API and each module individually.

Basic infra only! No content changes or improvements attempted! We should use this PR to figure out file name/folder conventions to use! Consistent page titles etc.! No decisions are final!

  • [x] redirects ? I've kept the name of the main API reference page so in the worst case people aren't getting 404s visiting content that has moved. Is having redirect from section headings to a new page practical?
  • [ ] one error message was force overwritten to pass link checks here; will need to be updated at source once we are confident in what changes this pr actually makes
  • [x] Page introductions. These were previously sections of a longer page, so they don't really introduce the page nicely at all yet; they start with another heading immediately after the page title etc.
  • [ ] Lunaria tracking - some translated pages have had links updated but there should be no other changes needed to those pages, so they should be ignored by the tracker. Only the English pages, and the nav should be tracked.

sarah11918 avatar Oct 15 '24 15:10 sarah11918

Deploy Preview for astro-docs-2 ready!

Name Link
Latest commit af5eb10be8fed7ab0e6f2028a6a532b83ace20ab
Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/671ba25cc1596a00088d6913
Deploy Preview https://deploy-preview-9687--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 configuration.

netlify[bot] avatar Oct 15 '24 15:10 netlify[bot]

Lunaria Status Overview

πŸŒ• This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en guides/actions.mdx Source changed, localizations will be marked as outdated.
en guides/content-collections.mdx Source changed, localizations will be marked as outdated.
en guides/imports.mdx Source changed, localizations will be marked as outdated.
en guides/internationalization.mdx Source changed, localizations will be marked as outdated.
en guides/markdown-content.mdx Source changed, localizations will be marked as outdated.
en guides/middleware.mdx Source changed, localizations will be marked as outdated.
en reference/api-reference.mdx Source changed, localizations will be marked as outdated.
en reference/errors/actions-returned-invalid-data-error.mdx Source changed, localizations will be marked as outdated.
en reference/modules/astro-actions.mdx Source added, will be tracked.
en reference/modules/astro-assets.mdx Source added, will be tracked.
en reference/modules/astro-content.mdx Source added, will be tracked.
en reference/modules/astro-i18n.mdx Source added, will be tracked.
en reference/modules/astro-middleware.mdx Source added, will be tracked.
en reference/modules/astro-transitions.mdx Source added, will be tracked.
en tutorials/add-content-collections.mdx Source changed, localizations will be marked as outdated.
it tutorials/add-content-collections.mdx Localization changed, will be marked as complete.
ja guides/content-collections.mdx Localization changed, will be marked as complete.
ja guides/imports.mdx Localization changed, will be marked as complete. πŸ”„οΈ
ja guides/middleware.mdx Localization changed, will be marked as complete.
ja reference/configuration-reference.mdx Localization changed, will be marked as complete.
pl guides/imports.mdx Localization changed, will be marked as complete. πŸ”„οΈ
en nav.ts Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
πŸ”„οΈ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

astrobot-houston avatar Oct 15 '24 15:10 astrobot-houston

It seems a bit weird to me having a "Reference" group and then a bunch of reference pages outside of that group. The word "reference" is also repeated in multiple links, but not all of them so it is inconsistent.

What if we nest them to keep the context and remove the repetition?

Current Nested and shortened
image image

Also changed "Error" to "Errors" to match "Directives" when the reference is about multiple things

Fryuni avatar Oct 23 '24 15:10 Fryuni

It seems a bit weird to me having a "Reference" group and then a bunch of reference pages outside of that group. The word "reference" is also repeated in multiple links, but not all of them so it is inconsistent.

I agree, but for context, this version of the sidebar is almost certainly a very short-lived iteration. We’re heading in the direction of something more like: https://docs-sidebar-topics.netlify.app/reference/configuration-reference/

delucis avatar Oct 23 '24 18:10 delucis

@Fryuni and @martrapp - would y'all be so kind as to check in particular the astro:transitions module here?

Most content in these pages is unchanged, just moved out into separate pages. BUT, because we noticed that some of these pages contain things you import from the module mixed with other reference content relevant to the feature, Chris and I decided to put an import section at the top of each page to distinguish.

The transitions page here is by far the most complicated one, and there were some items in there I was making best guesses about. So I'd love corrections/suggestions here!

sarah11918 avatar Oct 23 '24 20:10 sarah11918

I agree, but for context, this version of the sidebar is almost certainly a very short-lived iteration.

Yes, just for more context, a whole new sidebar/nav structure is coming before the end of the year so we're not at all concerned about getting the sidebar right here. The purpose of this PR is almost exclusively just to separate out this one huge page into individual ones. We're not even really improving content at this stage (even though some is needed!) -- this is entirely structural for two reasons:

  • immediately: Algolia cannot index this whole page and important reference items are not getting indexed!
  • if we at least split up the pages now, with minimal content change, then it's much easier for the translators to "catch up" with almost entirely copy/paste. Languages can prepare for the upcoming structural changes by at least having the right pages in place now with less disruption when the new sidebar comes.

sarah11918 avatar Oct 23 '24 21:10 sarah11918

saving for merge time:

@lunaria-track:src/content/docs/en/**/*.mdx;src/i18n/en/nav.ts

sarah11918 avatar Oct 24 '24 15:10 sarah11918