Skip to content

Commit

Permalink
Upgrade to Astro v3 guide (#4166)
Browse files Browse the repository at this point in the history
* initial page

* a few entries to get us started

* added some more entries

* document Astro.cookies, compressHTML and default port

* updates sidebar entry and adds more items to guide

* update sidebar in international versions

* add more entries

* typo: fix `astro.mjs.config` to `astro.config.mjs`

* refactor: endpoint methods to uppercase variants

* chore: update DEL to DELETE

* chore: remove `<Markdown />` component

* all beta 0 and 1 placeholders entered

* edit JSX entry

* all placeholder entries in up to date!

* added experimental flags to remove

* deleted the assets page since it won't be in new docs

* Update CSS Bundle Control for 3.0 (#4253)

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Use astro: namespace modules (#4239)

* feat: document astro features (#3924)

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* feat: document logger for Astro integrations (#3817)

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* removed Assets from sidebar since file was deleted

* updated image links to point to page we want them to visit

* edited removed astro image integration

* edited removed markdown component

* edited build config options moved to adapters

* remove extra build to adapter code samples

* updated typescript version entry

* kebab case, astro check entries done; end of REMOVEDs

* tralingslash default behavior entry

* htmlcompress entry

* scopedStyleStrategy and added links up to here

* typo in trailingSlash

* scoped style link

* inlineStyleSheets plus code example syntax fixes up to here

* class:list entries

* defalt port

* getStaticPaths flattening entry

* internal API endpoints entry

* squoosh sharp

* HTTP request methods and more links to this point

* shortened image service title

* astro.cookies entry

* final draft done!!

* feat: document adapter features (#3917)

Co-authored-by: Elian ☕️ <hello@elian.codes>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update capitalisation of GET

* Apply suggestions from EVERYONE's code review!

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Shinya Fujino <shf0811@gmail.com>

* Touche, Matthew.

Co-authored-by: Matthew Phillips <matthew@skypack.dev>

* Every time someone has a good idea, we commit!

Co-authored-by: J. B. Rainsberger <me@jbrains.ca>

* Document experimental JS API (#4234)

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update Firebase example to use cookies.has() (#4302)

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>

* last new entries for upgrade guide! Code freeze!

* Mostly formatting catches, also build config DEPRECATED and line highlighting

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Shinya Fujino <shf0811@gmail.com>

* missed a formatting correction

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* moves build config options down to deprecated section

* bluwy nits!

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>

* earlier link to image upgrade advice

* upgrade node version to 18.14.1 in English files only

* removed examples that listed astrojs/image

* Generate v3 reference docs (#4327)

* deleting es/guides/assets

* deleted guides/assets from nav.ts files that had it

* remove mention of assets folder from project structure

* Update `class:list` and astro-hash classes (#4322)

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Remove markdown draft reference (#4354)

* update endpoints

* update endpoints

* apply Blu's suggestions

* clearer, and scarier unexperimental image assets

* translatable

* View transitions 3.0 changes (#4320)

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* remove note to Team Docs

* remove Canadian spelling

* remove advice to uninstall sharp

* Fix import

Co-authored-by: Waxer59 <78129249+Waxer59@users.noreply.github.com>

* friendly note!

* ci: update reference docs (#4361)

Co-authored-by: delucis <delucis@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* ci: update integration docs (#4362)

Co-authored-by: delucis <delucis@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>

* add deprication note to simple objects in endpoints

* correct endpoints examples for ResponseWithEncoding

* backnit

* put the v in the 2

Co-authored-by: 李瑞丰 <liruifeng1024@gmail.com>

* put the v in the 3

Co-authored-by: 李瑞丰 <liruifeng1024@gmail.com>

* put the v in the 3 part 2

Co-authored-by: 李瑞丰 <liruifeng1024@gmail.com>

* wording

* chore: supplement `functionPerRoute` docs (#4419)

* chore: supplement `functionPerRoute` docs

* Update src/content/docs/en/reference/adapter-reference.mdx

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Add note about passing classes to children

* Add some whitespace

* i18n(ja): Update tutorial for v3 (#4415)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update `tutorial/` `V3` (#4372)

* update tutorial

* Update src/content/docs/es/tutorial/5-astro-api/4.mdx

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

---------

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update installation guides for v3 (#4414)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update install/v3 (#4379)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* ci: update integration docs (#4400)

Co-authored-by: delucis <delucis@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update `view-transitions.mdx v3` (#4370)

* update page

* fix broken links

* fix broken note

* fix typo

* fix broken link

* Apply suggestions from code review

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

---------

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(pt-BR): Update remaining `reference/` pages for 3.0 (#4407)

* i18n(pt-BR): Update remaining `reference/` pages for 3.0

* Apply suggestions from translation review

Co-authored-by: Alisson Nunes <alynva@gmail.com>

* Update to latest changes

* map -> mapa

Co-authored-by: Luiz Ferraz <luiz@lferraz.com>

* Better wording

* Fix whitespace

---------

Co-authored-by: Alisson Nunes <alynva@gmail.com>
Co-authored-by: Luiz Ferraz <luiz@lferraz.com>

* i18n(ja): Update integrations-guide.mdx for v3 (#4398)

* cbe66e9

* 1703b1d

* 60f35d6

* i18n(ja): Update integrations-guide.mdx for v3

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update vercel.mdx for v3 (#4397)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update styling.mdx for v3 (#4413)

* aedcab5

* a52460c

* i18n(ja): Update styling.mdx for v3

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update middleware.mdx for v3 (#4412)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update `reference/` `V3` (#4409)

* update pages

* Update src/content/docs/es/reference/adapter-reference.mdx

* Update src/content/docs/es/reference/cli-reference.mdx

* update page

* Apply suggestions from code review

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update content-collections.mdx for v3 (#4396)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update project-structure.mdx for v3 (#4395)

* 8104a41

* 577ca11

* i18n(ja): Update project-structure.mdx for v3

* Update src/content/docs/ja/core-concepts/project-structure.mdx

Co-authored-by: Kyosuke Nakamura <kyosuke@users.noreply.github.com>

---------

Co-authored-by: Kyosuke Nakamura <kyosuke@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update why-astro.mdx for v3 (#4394)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update `guides/` `V3` (#4383)

* update pages

* Apply suggestions from code review

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* update styling

---------

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update guides/integrations-guide/ V3 (#4381)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update guides/backend/ & guides/deploy/ V3 (#4380)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update recipes/ V3 (#4373)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Updated `concepts/` & `core-concepts/` `V3` (#4377)

* update pages

* apply changes

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(pt-BR): Update `view-transitions.mdx` for 3.0 (#4392)

* i18n(pt-BR): Translate `upgrade-to/v3` and update smaller 3.0 changes (#4386)

* i18n(pt-BR): Translate `upgrade-to/v3` and update smaller 3.0 changes

* Update PT-BR tutorial

* Reflect latest changes

* Update to latest changes

* Apply suggestions from translation review

Co-authored-by: Alisson Nunes <alynva@gmail.com>

* Update to latest changes

* Update to latest changes

* Fix links

* Fix all the broken links

---------

Co-authored-by: Alisson Nunes <alynva@gmail.com>

* i18n(es): Translate `v3.mdx` `V3` (#4375)

* translate sections

* translate page

* Apply suggestions from code review

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* add changes

* fix links

* update page

* update page

* update page

---------

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): Update vercel.mdx V3 (#4423)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* Add v3 callout to getting started page

* i18n(es): Update `images` `V3` (#4408)

* translate page

* Update src/content/docs/es/guides/images.mdx

* Update src/content/docs/es/guides/images.mdx

* update page

---------

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(zh-cn): Upgrade to Astro v3 guide for simplified Chinese  (#4353)

* i18n(zh-cn): uppercase http methods & some update.

* Update why-astro.mdx

* Update content-collection.mdx

* Update cloudflare.mdx

* Update markdown-content.mdx

* Update styling.mdx

* Update preact.mdx

* Update react.mdx & solid-js.mdx

* Update cli-reference.mdx

* Update adapter & configuration reference

* Update directives reference

* Update integrations reference

* Translate missing-sharp.mdx

* Remove blank line

* Update endpoints

* Update endpoints

* Update view transitions for v3

* upgrade to v3 translated

* Update src/content/docs/zh-cn/guides/styling.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/concepts/why-astro.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/concepts/why-astro.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/concepts/why-astro.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/concepts/why-astro.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/concepts/why-astro.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/concepts/why-astro.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/preact.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/preact.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/preact.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/react.mdx

* Update src/content/docs/zh-cn/guides/integrations-guide/solid-js.mdx

* Update src/content/docs/zh-cn/guides/integrations-guide/solid-js.mdx

* Update src/content/docs/zh-cn/guides/integrations-guide/react.mdx

* Update from v3-guide

* Update src/content/docs/zh-cn/guides/integrations-guide/react.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/solid-js.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/reference/directives-reference.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/preact.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/react.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/integrations-guide/solid-js.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/reference/configuration-reference.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/reference/configuration-reference.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/reference/integrations-reference.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/reference/integrations-reference.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/reference/integrations-reference.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Update endpoints.mdx

* Update endpoints.mdx

* Update v3.mdx

* Update v3.mdx

* Update src/content/docs/zh-cn/guides/view-transitions.mdx

Co-authored-by: Xiaoyue Lin <36526527+100gle@users.noreply.github.com>

* Update src/content/docs/zh-cn/guides/upgrade-to/v3.mdx

Co-authored-by: Genteure <genteure@gmail.com>

* Apply suggestions from code review

Co-authored-by: Genteure <genteure@gmail.com>

* Update some from upstream

* Update src/content/docs/zh-cn/reference/adapter-reference.mdx

Co-authored-by: Xiaoyue Lin <36526527+100gle@users.noreply.github.com>

---------

Co-authored-by: Genteure <genteure@gmail.com>
Co-authored-by: Xiaoyue Lin <36526527+100gle@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(ja): Update view-transitions.mdx for v3 (#4424)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* [v3 image assets] (#3739)

* starting to take notes

* notes re: using in Astro files

* draft - images in astro files

* choosing image img

* move v3 upgrade guide stuff to bottom

* draft - images in markdown files

* draft - images in mdx

* draft - images in framework components

* sprinkled a few more only local images optimized

* added and updates setting defaults on image component

* carried over other Images page sections

* split pages: images guide and other to be used elsewhere

* update assets folder guidance, and some formatting

* 3 migration guides - update links to image resources. NEED TO CHECK ALL CODE SAMPLES FOR USAGE

* update link to public folder

* link check in `ko` file

* drafted upgrade to v3 content

* v3 update guide - content collections advice

* add info re: Sharp the default

* more fine-tuning and reorg

* remove assets page and sidebar entry

* fixed links to old assets page in non-error pages

* update netlify.toml with redirect assets to images

* removes the old image integration guide and redirects to image

* replaced error messages locally for checks

* delete image integration guide from other languages

* removed the built-in alias from code samples and explanations

* remove references to assets folder entirely

* added info about remote images

* next pass at new image page (upgrade stuff still to do)

* address links, incl fake config-ref links

* another quick link hotfix in error message

* change remaining links to images; incl eggregious error message hotfixes

* move non-en images pages to old translations; update migrate-to links

* more link fixes in astro-components; missing-image-dimensions and from- guides

* draft pass at v3 upgrade stuff!

* some proper Spanish

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* fix long sentence

* quick formatting fixes

* Apply suggestions from code review

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>

* Update src/content/docs/en/guides/images.mdx

* remove too harsh info re image tag in Markdown

* Apply suggestions from Yan comma review

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* Update src/content/docs/en/guides/images.mdx

* removed experimental flag from image service api config example

* add code example showing removing astro integration

* moved the no op image service blurb into here from v3 guide

* updated from- guides with updated image assets content

* i18n(zh-cn): Translate images.mdx (#4314)

Co-authored-by: Camol <kwwnjujlc@gmail.com>
Co-authored-by: Xiaoyue Lin <36526527+100gle@users.noreply.github.com>

* Apply suggestions from morinokami code review

Co-authored-by: Shinya Fujino <shf0811@gmail.com>

* Everyone caught so many little fixes!

Co-authored-by: Elian ☕️ <hello@elian.codes>
Co-authored-by: Shinya Fujino <shf0811@gmail.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* extra line

Co-authored-by: Shinya Fujino <shf0811@gmail.com>

* another extra line

Co-authored-by: Shinya Fujino <shf0811@gmail.com>

* Rename and edit "4. Uninstall Sharp"

* i18n(zh-cn): Update zh from upstream (#4393)

* i18n(ja): Update images.mdx (#4418)

Co-authored-by: Kyosuke Nakamura <kyosuke@users.noreply.github.com>

* i18n(pt-BR): Update `images.mdx` for 3.0 (#4411)

* i18n(pt-BR): Update `images.mdx` for 3.0

* Apply suggestions from translation review

Co-authored-by: Alisson Nunes <alynva@gmail.com>

* oops, missed suggestion

Co-authored-by: Alisson Nunes <alynva@gmail.com>

* Update translation based on latest changes

* Fix typo

* Fix links

---------

Co-authored-by: Alisson Nunes <alynva@gmail.com>

* Bring back ES guide changes

---------

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: 李瑞丰 <liruifeng1024@gmail.com>
Co-authored-by: Camol <kwwnjujlc@gmail.com>
Co-authored-by: Xiaoyue Lin <36526527+100gle@users.noreply.github.com>
Co-authored-by: Shinya Fujino <shf0811@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Elian ☕️ <hello@elian.codes>
Co-authored-by: Kyosuke Nakamura <kyosuke@users.noreply.github.com>
Co-authored-by: Alisson Nunes <alynva@gmail.com>

* fix link 1

Co-authored-by: Waxer59 <78129249+Waxer59@users.noreply.github.com>

* fix link 2

Co-authored-by: Waxer59 <78129249+Waxer59@users.noreply.github.com>

* fix link 3

Co-authored-by: Waxer59 <78129249+Waxer59@users.noreply.github.com>

* Remove `#draft-pages` link

* i18n(zh-cn): Update getting-started.mdx (#4426)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* i18n(es): update getting started (#4427)

Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>

* Update PT-BR getting-started

* FIX ALL THEM LINKS

* fix link to experimental option

* FIX LINKS PLEASE

@tracker-major:./src/**/+(en|es|ja|zh-cn|pt-br)/concepts/*.mdx;./src/**/+(en|es|ja|zh-cn|pt-br)/core-concepts/*.mdx;./src/**/+(en|es|zh-cn)/guides/backend/*.mdx;./src/**/+(en|es|ja|zh-cn|pt-br)/guides/*.mdx;./src/**/+(en|es|ja|zh-cn|pt-br)/guides/deploy/*.mdx;./src/**/+(en|es|zh-cn)/guides/integrations-guide/*.mdx;./src/**/+(en|es|zh-cn)/guides/migrate-to-astro/*.mdx;./src/**/+(en|es|zh-cn|pt-br)/guides/upgrade-to/v3.mdx;./src/**/+(en|es|ja|zh-cn|pt-br)/install/*.mdx;./src/**/+(en|es|zh-cn|pt-br)/recipes/*.mdx;./src/**/+(en|es|zh-cn|pt-br)/reference/*.mdx;./src/**/+(en|es|zh-cn|pt-br)/reference/errors/*.mdx;./src/**/+(en|es|ja|zh-cn|pt-br)/tutorial/**/*.mdx;./src/**/+(en|es|zh-cn|pt-br)/getting-started.mdx;


---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: = <otterlord.dev@gmail.com>
Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Shinya Fujino <shf0811@gmail.com>
Co-authored-by: J. B. Rainsberger <me@jbrains.ca>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Waxer59 <78129249+Waxer59@users.noreply.github.com>
Co-authored-by: Houston (Bot) <108291165+astrobot-houston@users.noreply.github.com>
Co-authored-by: delucis <delucis@users.noreply.github.com>
Co-authored-by: 李瑞丰 <liruifeng1024@gmail.com>
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Alisson Nunes <alynva@gmail.com>
Co-authored-by: Luiz Ferraz <luiz@lferraz.com>
Co-authored-by: Kyosuke Nakamura <kyosuke@users.noreply.github.com>
Co-authored-by: Genteure <genteure@gmail.com>
Co-authored-by: Xiaoyue Lin <36526527+100gle@users.noreply.github.com>
Co-authored-by: Camol <kwwnjujlc@gmail.com>
  • Loading branch information
1 parent d486a2b commit a4fe776
Show file tree
Hide file tree
Showing 250 changed files with 10,306 additions and 5,467 deletions.
8 changes: 8 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@
from = "/:lang/guides/client-side-routing"
to = "/:lang/guides/view-transitions"

[[redirects]]
from = "/:lang/guides/assets"
to = "/:lang/guides/images"

[[redirects]]
from = "/:lang/guides/integrations-guide/image"
to = "/:lang/guides/images"

[[redirects]]
from = "/:lang/migration/0.21.0"
to = "/:lang/guides/upgrade-to/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Since from '~/components/Since.astro';
Astro bietet dir verschiedene Möglichkeiten, Bilder auf deiner Website zu verwenden, ganz gleich, ob sie lokal in deinem Projekt gespeichert sind, auf anderen Quellen verlinkt werden oder in einem CMS oder CDN gespeichert sind!

:::note[Assets verwenden (Experimentell)]
Die experimentelle Asset-Unterstützung wurde in `astro@2.1.0` hinzugefügt. Wenn du die Unterstützung für Assets aktiviert hast, findest du weitere Informationen in der [Asset-Anleitung (Experimentell)](/de/guides/assets/).
Die experimentelle Asset-Unterstützung wurde in `astro@2.1.0` hinzugefügt. Wenn du die Unterstützung für Assets aktiviert hast, findest du weitere Informationen in der [Asset-Anleitung (Experimentell)](/de/guides/images/).

**Einige der folgenden Ratschläge sind nicht mit der experimentellen Flag kompatibel.**
:::
Expand Down Expand Up @@ -38,7 +38,7 @@ import rocket from '../images/rocket.svg';

Du kannst die Standard Markdown `![]()` Syntax oder die Standard HTML `<img>`-Tags in deinen `.md`-Dateien für Bilder verwenden, die sich in deinem `public/`-Ordner befinden, oder für Remote-Bilder auf einem anderen Server.

Wenn du deine Bilder nicht in `public/` speichern kannst, empfehlen wir, die [experimentelle Unterstützung für Assets](/de/guides/assets/) zu aktivieren oder das Dateiformat `.mdx` zu verwenden, mit dem du importierte Komponenten mit einer Markdown-ähnlichen Syntax kombinieren kannst. Verwende die [MDX-Integration](/de/guides/integrations-guide/mdx/), um Astro-Unterstützung für MDX hinzuzufügen.
Wenn du deine Bilder nicht in `public/` speichern kannst, empfehlen wir, die [experimentelle Unterstützung für Assets](/de/guides/images/) zu aktivieren oder das Dateiformat `.mdx` zu verwenden, mit dem du importierte Komponenten mit einer Markdown-ähnlichen Syntax kombinieren kannst. Verwende die [MDX-Integration](/de/guides/integrations-guide/mdx/), um Astro-Unterstützung für MDX hinzuzufügen.

```md
<!-- src/pages/post-1.md -->
Expand Down Expand Up @@ -121,7 +121,7 @@ Das Attribut `src` ist **relativ zum öffentlichen Ordner**. In Markdown kannst

### `src/assets/` (experimentell)

In der Anleitung [Assets (Experimentell)](/de/guides/assets/) kannst du nachlesen, wie du den Ordner `/assets/` experimentell nutzen kannst.
In der Anleitung [Assets (Experimentell)](/de/guides/images/) kannst du nachlesen, wie du den Ordner `/assets/` experimentell nutzen kannst.

Dazu musst du deine bestehenden Bilder aktualisieren, die aktuelle Astro-Bildintegration entfernen und zusätzliche manuelle Änderungen vornehmen, um einige der neuen Funktionen zu nutzen.

Expand All @@ -132,7 +132,7 @@ Die offizielle Bild-Integration von Astro bietet zwei verschiedene Astro-Kompone
Nach der [Installation von `@astrojs/image`](/de/guides/integrations-guide/image/#installation) kannst du diese beiden Komponenten überall dort verwenden, wo du Astro-Komponenten verwenden kannst: in `.astro`- und `.mdx`-Dateien.

:::note[Inkompatibel mit Assets]
Wenn du die experimentelle Asset-Unterstützung aktiviert hast, musst du die offizielle Integration deinstallieren. Weitere Informationen findest du im [Assets (Experimental) Guide](/de/guides/assets/).
Wenn du die experimentelle Asset-Unterstützung aktiviert hast, musst du die offizielle Integration deinstallieren. Weitere Informationen findest du im [Assets (Experimental) Guide](/de/guides/images/).
:::

### `<Image />`
Expand Down
File renamed without changes.
373 changes: 373 additions & 0 deletions old-translations/ja/images.mdx

Large diffs are not rendered by default.

163 changes: 163 additions & 0 deletions old-translations/zh-CN/guides/images.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
title: 图片
description: 学习如何在 Astro 项目中包含图片。
i18nReady: true
---
import Since from '~/components/Since.astro';


在 Astro 项目中,有很多种在网站中使用图片的方式。无论是用存储在项目中的图片,还是链接外部图片,亦或从像 CMS(内容管理系统)或 CDN(内容分发网络)这样的地方加载图片,都没问题!

:::note[`astro:assets` (Experimental - coming in v3.0)]
实验性 `astro:assets` 模块将在 `astro@3.0` 中默认启用.

请按照 [资源(实验性)使用指南](/zh-cn/guides/images/) 开始使用新的图片解决方案!

**下面的一些建议可能与实验性标志不兼容。如果你正在使用 `astro:assets` 请参考资源页面。**
:::

### `.astro` 文件中

你可以在 `.astro` 文件中使用标准的 HTML `<img>``<img />` 元素来展示图片,同时也支持所有 HTML 图片属性。

src 属性是必需的,其格式取决于图像的存储位置以及你是否启用了对资源的实验性支持:

```astro
---
// src/pages/index.astro
import rocket from '../images/rocket.svg';
---
<!-- 位于其它服务器上的图片 -->
<img src="https://docs.astro.build/assets/logomark-light.png" width="25" alt="Astro">
<!-- 存储在 public/assets/stars.png 的本地图片 -->
<img src="/assets/stars.png" alt="一片繁星闪烁的夜空。">
<!-- 存储在 src/images/rocket.svg 的本地图片 -->
<img src={rocket} alt="外空中的一架火箭。"/>
```

### 在 Markdown 文件中

可以在 `.md` 文件中使用 Markdown 标准语法 `![]()`,或 HTML 标准语法 `<img>` 标签,来调用位于 `public/` 文件夹下或其它服务器上的图片。

如果你无法将图片保留在 `public/` 中,我们建议启用 [资源的实验性支持](/zh-cn/guides/images/), 或使用 `.mdx` 文件格式,该格式允许你将导入的组件与类似 Markdown 的语法结合起来。使用 [MDX 集成](/zh-cn/guides/integrations-guide/mdx/) 向 Astro 添加对 MDX 的支持。
```md
<!-- src/pages/post-1.md -->

# 我的 Markdown 页面

<!-- 存储在 public/assets/stars.png 的本地图片 -->
![一片繁星闪烁的夜空。](/assets/stars.png)
<img src="/assets/stars.png" alt="一片繁星闪烁的夜空。">

<!-- 位于其它服务器上的图片 -->
![Astro](https://docs.astro.build/assets/logomark-light.png)
<img src="https://docs.astro.build/assets/logomark-light.png" width="25" alt="Astro">
```

### 在 MDX 文件中

你可以在 .mdx 文件中使用标准 Markdown `![]()` 语法或 JSX 的 `<img />` 标签来显示 `public/ ` 文件夹或远程服务器中的图片。

此外,你也可以导入和使用位于项目 `src/` 目录中的图像,就像在 Astro 组件中一样。


```mdx title="src/pages/post-1.mdx"

import rocket from '../images/rocket.svg';

# My MDX Page

// 存放在项目中 src/images/rocket.svg 路径的图片
<img src={rocket} alt="外空中的一架火箭。"/>

// 存放在项目中 public/assets/stars.png 路径的图片
![一片繁星闪烁的夜空。](/assets/stars.png)
<img src="/assets/stars.png" alt="一片繁星闪烁的夜空。" />

// 位于其它服务器上的图片
![Astro](https://docs.astro.build/assets/logomark-light.png)
<img src="https://docs.astro.build/assets/logomark-light.png" width="25" alt="Astro" />
```

### UI 框架中的组件

当在 [UI 框架组件](/zh-cn/core-concepts/framework-components/)(例如 React、Svelte)中添加图像时,请使用适合该框架的图像语法。



## 存放图片的位置

### `src/`

存储在 `src/`中的图像可以由组件(`.astro``.mdx`和其他 UI 框架)使用,但不能在 Markdown 文档中使用。

如果您必须使用 Markdown 文档,我们建议你将图像保存在 ['public/'](#public) 中或 [远程](#使用-cms-或-cdn-上的图片) 存储他们。

从任何组件文档中的 **相对文档路径**[导入别名](/zh-cn/guides/aliases/) 导入它们,然后像使用 `src`属性一样使用。

```astro
---
// src/pages/index.astro
// Access images in `src/images/`
import logo from '../images/logo.png';
---
<img src={logo} width="40" alt="Astro 的图标" />
```

### `public/`

存储在 `public/` 中的图像可以被组件(`.astro``.mdx`和其他UI框架)和Markdown文档使用。

然而,位于 `/public` 目录中的文件始终按原样提供或复制,不进行任何处理。如果你在 Markdown 文件之外使用图像,我们建议尽可能将本地图像保存在 `src/` 中,以便 Astro 对其进行转换、优化和打包。

`src` 属性是 **相对于 public 文件夹的**。在 Markdown 中,你可以使用 `![]()` 表示。

```astro
---
// src/pages/index.astro
// 存取放在 `public/images/` 里的图片
---
<img src="/images/logo.png" />
```

### `src/assets/` (实验性)

请参阅 [资源(实验性)](/zh-cn/guides/images/) 指南,了解如何启用 `/assets/` 文件夹的实验性用法。

这将需要你更新现有图片,删除当前的 Astro 图片集成,并且还需要额外的手动更改以利用其某些新功能。

## Astro 的图片集成

:::note[将在 v3.0 中弃用]
Astro v3 将不再主动支持 [`@astrojs/image`](https://github.com/withastro/astro/tree/main/packages/integrations/image) 集成

我们建议你尽早删除它,并使用将内置在 `astro@3.0` 中的实验性 `astro:assets` 模块。

请按照 [资源(实验性)使用指南](/zh-cn/guides/images/) 开始使用新的图片解决方案!

**`astro:assets` 目前还不能完全替代 `@astrojs/image` ,但它正在被积极开发中。**
:::

有关在 Astro v2 中使用 `@astrojs/image` 的文档,请参阅 [`@astrojs/image` 文档](https://github.com/withastro/astro/blob/main/packages/integrations/image/README.md)

## 使用 CMS 或 CDN 上的图片

Image CDN 可与 Astro 配合使用,可将图片的完整网址作为 `<img>` 标签中的 `src` 属性或 Markdown 标记

如果 CDN 提供了 Node.js SDK ,则可以在项目中使用它。例如,[Cloudinary 的 SDK](https://cloudinary.com/documentation/node_integration) 可以生成带有相应 `src` 属性 的 ` <img>` 标签。

## Alt Text

并非所有用户都能以相同的方式查看图片,因此在使用图片时可访问性是一个特别重要的问题。使用 `alt` 属性为图片提供 [描述性替代文本](https://www.w3.org/WAI/tutorials/images/)

此属性对于映像集成的 `<Image />``<Picture/>` 组件是必需的,如果未提供替代文本,这些组件将引发错误。

如果图像只是装饰性的(即无助于理解页面)请设置 `alt=""`,以便屏幕阅读器知道忽略该图像。

## 社区开发的集成

除了官方的 [`@astrojs/image`](/zh-cn/guides/integrations-guid/image/) 集成外,社区还开发了[社区图片集成](https://astro.build/integrations?search=images),用于处理和优化 Astro 项目中的图片。
2 changes: 1 addition & 1 deletion src/content/docs/ar/core-concepts/astro-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const { title } = Astro.props

- لا يدعمون frontmatter، أو الإستيراد على جانب الخادم (Server-side imports)، أو التعابير الديناميكية.
- أي وسوم `<script>` تُركت غير مجمّعة، سيتم التعامل معها كما لو انها تحتوي على `is:inline`.
- يمكنهم فقط [إسناد الموارد الموجودة في مجلد `public/`](/ar/guides/images/#public)
- يمكنهم فقط [إسناد الموارد الموجودة في مجلد `public/`](/ar/core-concepts/project-structure/#public)

:::note
[عنصر `<slot />`](/ar/core-concepts/astro-components/#المداخل) الموجود داخل مكوّن HTML سيعمل كما يعمل في مكوّن أسترو. لإستخدام عنصر ["HTML Web Component Slot"](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) بدلًا من ذلك، أضف `is:inline` إلى عنصر `<slot />` الخاص بك.
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/concepts/why-astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ One of our favorite sayings is: **opt-in to complexity.** We designed Astro to r

**Astro is an all-in-one web framework that comes with everything you need to build a website.** Astro includes a component syntax, file-based routing, asset handling, a build process, bundling, optimizations, data-fetching, and more. You can build great websites without ever reaching outside of Astro's core feature set.

If you need more control, you can extend Astro with over [100+ integrations](https://astro.build/integrations/) like [React](https://www.npmjs.com/package/@astrojs/react), [Svelte](https://www.npmjs.com/package/@astrojs/svelte), [Vue](https://www.npmjs.com/package/@astrojs/vue), [Tailwind CSS](https://www.npmjs.com/package/@astrojs/tailwind), [MDX](https://www.npmjs.com/package/@astrojs/mdx), [image optimizations](https://www.npmjs.com/package/@astrojs/image), and more. [Connect your favorite CMS](/en/guides/cms/) or [deploy to your favorite host](/en/guides/deploy/) with just a single command.
If you need more control, you can extend Astro with over [100+ integrations](https://astro.build/integrations/) like [React](https://www.npmjs.com/package/@astrojs/react), [Svelte](https://www.npmjs.com/package/@astrojs/svelte), [Vue](https://www.npmjs.com/package/@astrojs/vue), [Tailwind CSS](https://www.npmjs.com/package/@astrojs/tailwind), [MDX](https://www.npmjs.com/package/@astrojs/mdx), and more. [Connect your favorite CMS](/en/guides/cms/) or [deploy to your favorite host](/en/guides/deploy/) with just a single command.

Astro is UI-agnostic, meaning you can **Bring Your Own UI Framework (BYOF)**. React, Preact, Solid, Svelte, Vue, and Lit are all officially supported in Astro. You can even mix and match different frameworks on the same page, making future migrations easier and preventing project lock-in to a single framework.
2 changes: 1 addition & 1 deletion src/content/docs/en/core-concepts/astro-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Astro supports importing and using `.html` files as components or placing these
HTML components must contain only valid HTML, and therefore lack key Astro component features:
- They don't support frontmatter, server-side imports, or dynamic expressions.
- Any `<script>` tags are left unbundled, treated as if they had `is:inline`.
- They can only [reference assets that are in the `public/` folder](/en/guides/images/#public).
- They can only [reference assets that are in the `public/` folder](/en/core-concepts/project-structure/#public).

:::note
A [`<slot />` element](/en/core-concepts/astro-components/#slots) inside an HTML component will work as it would in an Astro component. In order to use the [HTML Web Component Slot](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) element instead, add `is:inline` to your `<slot>` element.
Expand Down
Loading

0 comments on commit a4fe776

Please sign in to comment.