Skip to content

Commit

Permalink
Update astro.build/asset links to live assets in repo (withastro#3016)
Browse files Browse the repository at this point in the history
* Fix broken asset links

- Replace broken `https://astro.build/assets` links with new working links
- Update alt texts

* Switch to assets hosted in docs

- Add `/public/assets` folder
- Add all logo assets and rays / arc wallpaper to `/public/assets`
- Update links to use `docs.astro.build`

* Fix image format

- Switch .webp to .png

* Fix folder name, switch back to webp

- Rename folder to `assets`
- Switch back to `webp` for arc and rays wallpapers

* Fix image file names

- Fix image names to fit pathnames

---------

Co-authored-by: BryceRussell <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
  • Loading branch information
3 people authored Apr 25, 2023
1 parent 02d1f39 commit 8077640
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
Binary file added public/assets/arc.webp
Binary file not shown.
Binary file added public/assets/full-logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/full-logo-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/logomark-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/logomark-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/rays.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/content/docs/en/core-concepts/endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The return object can also have an `encoding` property. It can be any valid [`Bu

```ts title="src/pages/astro-logo.png.ts" {6}
export async function get({ params, request }) {
const response = await fetch("https://astro.build/assets/press/full-logo-light.png");
const response = await fetch("https://docs.astro.build/assets/full-logo-light.png");
const buffer = Buffer.from(await response.arrayBuffer());
return {
body: buffer,
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/guides/assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ Your existing images in `public/` and remote images are still valid but are not
<img src="/images/stars.png" alt="A starry night sky.">

<!-- Remote image on another server -->
![Astro logo](https://astro.build/assets/logo.png)
<img src="https://astro.build/assets/logo.png" width="25" alt="Astro logo">
![Astro logo](https://docs.astro.build/assets/logomark-light.png)
<img src="https://docs.astro.build/assets/logomark-light.png" width="25" alt="Astro logo">
```

### Convert from `@astrojs/image`
Expand Down
18 changes: 9 additions & 9 deletions src/content/docs/en/guides/images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The `src` attribute is required, and its format will depend on where your images
import rocket from '../images/rocket.svg';
---
<!-- Remote image on another server -->
<img src="https://astro.build/assets/logo.png" width="25" alt="Astro">
<img src="https://docs.astro.build/assets/logomark-light.png" width="25" alt="Astro">
<!-- Local image stored at public/assets/stars.png -->
<img src="/assets/stars.png" alt="A starry night sky.">
Expand All @@ -50,8 +50,8 @@ If you cannot keep your images in `public/`, we recommend enabling [experimental
<img src="/assets/stars.png" alt="A starry night sky.">

<!-- Remote image on another server -->
![Astro](https://astro.build/assets/logo.png)
<img src="https://astro.build/assets/logo.png" width="25" alt="Astro">
![Astro](https://docs.astro.build/assets/logomark-light.png)
<img src="https://docs.astro.build/assets/logomark-light.png" width="25" alt="Astro">
```

### In MDX files
Expand All @@ -74,8 +74,8 @@ import rocket from '../images/rocket.svg';
<img src="/assets/stars.png" alt="A starry night sky." />

// Remote image on another server
![Astro](https://astro.build/assets/logo.png)
<img src="https://astro.build/assets/logo.png" width="25" alt="Astro" />
![Astro](https://docs.astro.build/assets/logomark-light.png)
<img src="https://docs.astro.build/assets/logomark-light.png" width="25" alt="Astro" />
```

### In UI Framework Components
Expand Down Expand Up @@ -267,7 +267,7 @@ Your original image will be copied unprocessed to the build folder, like all fil
---
import { Picture } from '@astrojs/image/components';
import localImage from '../assets/logo.png';
const remoteImage = 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
const remoteImage = 'https://docs.astro.build/assets/full-logo-light.png';
---
<!--Local image with multiple sizes and formats-->
Expand All @@ -294,12 +294,12 @@ In `.mdx` files, `<Image />` and `<Picture />` can receive your image `src` thro
import { Image, Picture } from '@astrojs/image/components';
import rocket from '../assets/rocket.png';
export const galaxy = 'https://astro.build/assets/galaxy.jpg';
export const logo = 'https://docs.astro.build/assets/full-logo-light.png';
<Image src={import('../assets/logo.png')} alt="Astro"/>
<Image src={import('../assets/galaxy.png')} alt="Outer space."/>
<Image src={rocket} width={300} alt="Spaceship approaching the moon."/>
<Picture src={rocket} widths={[200, 400, 800]} sizes="(max-width: 800px) 100vw, 800px" alt="A rocket blasting off." />
<Picture src={galaxy} widths={[200, 400, 800]} aspectRatio={16/9} sizes="(max-width: 800px) 100vw, 800px" alt="Outer space." />
<Picture src={logo} widths={[200, 400, 800]} aspectRatio={16/9} sizes="(max-width: 800px) 100vw, 800px" alt="The full Astro logo." />
```

### Setting Default Values
Expand Down
12 changes: 6 additions & 6 deletions src/content/docs/en/tutorial/2-pages/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Now that you have built pages using `.astro` files, let's make some blog posts u
description: 'This is the first post of my new Astro blog.'
author: 'Astro Learner'
image:
url: 'https://astro.build/assets/blog/astro-1-release-update/cover.jpeg'
alt: 'The Astro logo with the word One.'
url: 'https://docs.astro.build/assets/full-logo-light.png'
alt: 'The full Astro logo.'
tags: ["astro", "blogging", "learning in public"]
---
# My First Blog Post
Expand Down Expand Up @@ -112,8 +112,8 @@ The information at the top of the file, inside the code fences, is called frontm
author: Astro Learner
description: "After learning some Astro, I couldn't stop!"
image:
url: "https://astro.build/assets/blog/astro-showcase/astro-showcase-screenshot.jpg"
alt: "Thumbnails of websites from the Astro Showcase site."
url: "https://docs.astro.build/assets/arc.webp"
alt: "Thumbnail of Astro arcs,"
pubDate: 2022-07-08
tags: ["astro", "blogging", "learning in public", "successes"]
---
Expand All @@ -126,8 +126,8 @@ The information at the top of the file, inside the code fences, is called frontm
author: Astro Learner
description: "I had some challenges, but asking in the community really helped!"
image:
url: "https://astro.build/assets/blog/community-day/cover.jpg"
alt: "The word community with a heart."
url: "https://docs.astro.build/assets/rays.webp"
alt: "Thumbnail of Astro rays."
pubDate: 2022-07-15
tags: ["astro", "learning in public", "setbacks", "community"]
---
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/tutorial/4-layouts/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ When you include the `layout` frontmatter property in an `.md` file, all of your
description: 'This is the first post of my new Astro blog.'
author: 'Astro Learner'
image:
url: 'https://astro.build/assets/blog/astro-1-release-update/cover.jpeg'
alt: 'The Astro logo with the word One.'
url: 'https://docs.astro.build/assets/full-logo-light.png'
alt: 'The full Astro logo.'
tags: ["astro", "blogging", "learning in public"]
---
```
Expand Down

0 comments on commit 8077640

Please sign in to comment.