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

feat: Add Bluesky showcase component and update docs #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hungry-ducks-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'starlight-showcases': patch
---

Adds Bluesky showcase component.
58 changes: 58 additions & 0 deletions docs/src/content/docs/components/bluesky.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Bluesky
description: Learn how to use the Bluesky component to showcase posts.
sidebar:
order: 6
---

The `<ShowcaseBluesky>` component can be used to showcase Bluesky posts.

## Import

```js
import { ShowcaseBluesky } from 'starlight-showcases'
```

## Usage

Specify a list of Bluesky posts to display using the `entries` prop.

import { Preview } from '@hideoo/starlight-plugins-docs-components'
import { ShowcaseBluesky } from 'starlight-showcases'

<Preview>

```mdx title="src/content/docs/showcase.mdx"
import { ShowcaseBluesky } from 'starlight-showcases'

<ShowcaseBluesky
entries={[
'https://bsky.app/profile/astro.build/post/3lifesehhok27',
'https://bsky.app/profile/astro.build/post/3ld7tgc2cts2l',
]}
/>
```

<ShowcaseBluesky
slot="preview"
entries={[
'https://bsky.app/profile/astro.build/post/3lifesehhok27',
'https://bsky.app/profile/astro.build/post/3ld7tgc2cts2l',
]}
/>

</Preview>

The `<ShowcaseBluesky>` component uses [Astro Embed](https://astro-embed.netlify.app/) to load a minimal version of Bluesky’s widget with zero JavaScript and only static HTML content.

## Props

The `<ShowcaseBluesky>` component accepts the following props:

### `entries`

**required**
**type:** `string[]`

The list of Bluesky post URLs to display.
See the [Usage](#usage) section for an example.
2 changes: 1 addition & 1 deletion docs/src/content/docs/components/profiles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Profiles
description: Learn how to use the profile component to showcase profiles including a name, description, picture and link.
sidebar:
order: 7
order: 8
---

The `<ShowcaseProfile>` component can be used to showcase profiles like GitHub users, repositories or any other profile.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/components/quotes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Quotes
description: Learn how to use the quotes component to showcase quotes.
sidebar:
order: 6
order: 7
---

The `<ShowcaseQuote>` component can be used to showcase quotes which can link to their respective sources.
Expand Down
14 changes: 14 additions & 0 deletions docs/src/content/docs/demo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ import { ShowcaseTwitter } from 'starlight-showcases'
]}
/>

## Bluesky

To showcase Bluesky posts, use the [`<ShowcaseBluesky>`](/components/bluesky/) component.

import { ShowcaseBluesky } from 'starlight-showcases'

<ShowcaseBluesky
entries={[
'https://bsky.app/profile/astro.build/post/3lifesehhok27',
'https://bsky.app/profile/astro.build/post/3ld7tgc2cts2l',
'https://bsky.app/profile/astro.build/post/3lajaipuxdk2x',
]}
/>

## Quotes

To showcase quote entries, use the [`<ShowcaseQuote>`](/components/quotes/) component.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to add author showcase pages to your documentation with t

A set of [Starlight](https://starlight.astro.build) components to author showcase pages for your documentation.

Different type of showcase items can be displayed, such as [text](/components/text/), [images](/components/images/), [YouTube videos](/components/youtube/), [Twitter posts](/components/twitter/), [quotes](/components/quotes/), and [profiles](/components/profiles/).
Different type of showcase items can be displayed, such as [text](/components/text/), [images](/components/images/), [YouTube videos](/components/youtube/), [Twitter posts](/components/twitter/), [Bluesky posts](/components/bluesky/), [quotes](/components/quotes/), and [profiles](/components/profiles/).

Check out the [demo](/demo/) for a preview of the components in action.

Expand Down
2 changes: 1 addition & 1 deletion packages/starlight-showcases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Want to get started immediately? Check out the [getting started guide](https://s

A set of [Starlight](https://starlight.astro.build) components to author showcase pages for your documentation.

Different type of showcase items can be displayed, such as [text](https://starlight-showcases.vercel.app/components/text/), [images](https://starlight-showcases.vercel.app/components/images/), [YouTube videos](https://starlight-showcases.vercel.app/components/youtube/), [Twitter posts](https://starlight-showcases.vercel.app/components/twitter/), [quotes](https://starlight-showcases.vercel.app/components/quotes/), and [profiles](https://starlight-showcases.vercel.app/components/profiles/).
Different type of showcase items can be displayed, such as [text](https://starlight-showcases.vercel.app/components/text/), [images](https://starlight-showcases.vercel.app/components/images/), [YouTube videos](https://starlight-showcases.vercel.app/components/youtube/), [Twitter posts](https://starlight-showcases.vercel.app/components/twitter/), [Bluesky posts](https://starlight-showcases.vercel.app/components/bluesky/), [quotes](https://starlight-showcases.vercel.app/components/quotes/), and [profiles](https://starlight-showcases.vercel.app/components/profiles/).

> [!NOTE]
> Credits to [Chris Swithinbank (@delucis)](https://github.com/delucis/) for the original idea and implementation in the [Starlight documentation](https://starlight.astro.build/resources/showcase/) and also creating the [Astro Embed](https://astro-embed.netlify.app/) library used in this project.
Expand Down
22 changes: 22 additions & 0 deletions packages/starlight-showcases/components/ShowcaseBluesky.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
import ShowcaseBlueskyCard from './ShowcaseBlueskyCard.astro'

export type ShowcaseBlueskyProps = Props

interface Props {
entries: string[]
}

const { entries } = Astro.props
---

<div class="not-content sl-flex">
{entries.map((href) => <ShowcaseBlueskyCard {href} />)}
</div>

<style>
div {
flex-direction: column;
gap: 1rem;
}
</style>
13 changes: 13 additions & 0 deletions packages/starlight-showcases/components/ShowcaseBlueskyCard.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
import { BlueskyPost } from '@astro-community/astro-embed-bluesky'

interface Props {
href: string
}

const { href } = Astro.props
---

<div class="starlight-showcases-bluesky-card">
<BlueskyPost id={href} />
</div>
1 change: 1 addition & 0 deletions packages/starlight-showcases/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as ShowcaseBluesky, type ShowcaseBlueskyProps } from './components/ShowcaseBluesky.astro'
export { default as ShowcaseCTA, type ShowcaseCTAProps } from './components/ShowcaseCTA.astro'
export { default as ShowcaseText, type ShowcaseTextProps } from './components/ShowcaseText.astro'
export { default as ShowcaseImage, type ShowcaseImageProps } from './components/ShowcaseImage.astro'
Expand Down
1 change: 1 addition & 0 deletions packages/starlight-showcases/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"lint": "eslint . --cache --max-warnings=0"
},
"dependencies": {
"@astro-community/astro-embed-bluesky": "^0.1.3",
"@astro-community/astro-embed-twitter": "^0.5.8",
"@astro-community/astro-embed-youtube": "^0.5.6"
},
Expand Down
95 changes: 95 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.