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

revert #182

Merged
merged 2 commits into from
Jul 15, 2024
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/community-content.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Create Community Content

on:
workflow_dispatch:
# pull_request:
# paths:
# - "src/content/resources/**.json"
pull_request:
paths:
- "src/content/resources/**.json"

permissions:
contents: write
Expand Down
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"typescript.tsdk": "node_modules/typescript/lib",
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
}
"typescript.tsdk": "node_modules/typescript/lib"
}
9 changes: 5 additions & 4 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default defineConfig({
redirects: {
'/recipes/how-to-add-gsap': '/tips/how-to-add-gsap',
'/contributing': '/#want-to-get-involved',
'/resources/educational': '/external-resources',
},
experimental: {
contentCollectionJsonSchema: true,
Expand Down Expand Up @@ -56,9 +55,11 @@ export default defineConfig({
},
},
{
label: 'External resources',
badge: 'Updated',
link: '/external-resources',
label: 'Resources',
badge: 'New',
autogenerate: {
directory: 'resources',
},
},
],
components: {
Expand Down
40 changes: 40 additions & 0 deletions src/components/ResourceCards.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
import { getCollection } from "astro:content";

import { CardGrid, LinkCard } from "@astrojs/starlight/components";

interface Props {
category:
| "css"
| "auth"
| "rss"
| "images"
| "editor"
| "markdown"
| "performance"
| "utilities"
| "animation"
| "i18n"
| "db"
| "deploy"
| "view-transitions"
| "3rd-party";
}

const { category } = Astro.props;
const allResources = await getCollection("resources", ({ data }) => {
return data.category === category;
});
---

<CardGrid>
{
allResources.map((r) => (
<LinkCard
title={r.data.title}
description={r.data.description ?? ""}
href={r.data.link}
/>
))
}
</CardGrid>
116 changes: 0 additions & 116 deletions src/components/Tags.astro

This file was deleted.

18 changes: 17 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,23 @@ const starlightSchema = defineCollection({
const resourcesSchema = defineCollection({
type: 'data',
schema: z.object({
tags: z.array(z.string()),
category: z.enum([
'css',
'auth',
'rss',
'images',
'editor',
'markdown',
'performance',
'utilities',
'animation',
'i18n',
'db',
'deploy',
'view-transitions',
'3rd-party',
'migration',
]),
title: z.string(),
link: z.string(),
description: z.string().optional(),
Expand Down
75 changes: 75 additions & 0 deletions src/content/docs/resources/educational.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Community Resources
---

import ResourceCards from '~/components/ResourceCards.astro'

See guided examples of adding features to your Astro project, submitted by our community members!

[Astro recipes](https://docs.astro.build/en/recipes/) are typically short, focused how-to guides that walk a reader through completing a working example of a specific task. Recipes are a great way to add new features or behavior to your Astro project by following step-by-step instructions!

Other guides might explain concepts related to an area of content, such as using images or working with MDX.

{/* :::tip[Add your own!]
Have you written a recipe for Astro? [Edit this page](https://github.com/withastro/docs/edit/main/src/content/docs/en/community-resources/content.mdx) and add your link in the appropriate section!
::: */}

### CSS

<ResourceCards category='css'/>

### Authentication

<ResourceCards category='auth'/>

### RSS

<ResourceCards category='rss'/>

### Images

<ResourceCards category='images'/>

### Editor Tooling

<ResourceCards category='editor'/>

### Markdown

<ResourceCards category='markdown'/>

### Performance

<ResourceCards category='performance'/>

### Utilities

<ResourceCards category='utilities'/>

### Animation

<ResourceCards category='animation'/>

### Internationalization and Localization

<ResourceCards category='i18n'/>

### Astro DB

<ResourceCards category='db'/>

### Deploy

<ResourceCards category='deploy'/>

### View transitions

<ResourceCards category='view-transitions'/>

### Integrating with 3rd-party services

<ResourceCards category='3rd-party'/>

### Migrations

<ResourceCards category='migration'/>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["db"],
"category": "db",
"title": "Astro DB: Migrating my analytics data from Vercel Postgres",
"link": "https://www.thomasledoux.be/blog/astro-db-migrating-analytics-postgres",
"updated": "2024-03-29"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["rss"],
"category": "rss",
"title": "Astro Component: Fetching Latest YouTube Videos with RSS",
"link": "https://techsquidtv.com/blog/astro-fetching-youtube-videos-with-rss/",
"updated": "2024-02-13"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/astro-plus-photoswipe.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["images"],
"category": "images",
"title": "Astro + PhotoSwipe",
"link": "https://dev.to/petrovicz/astro-photoswipe-549a",
"updated": "2024-04-04"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/avoid-repeating-your-markup.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["css"],
"category": "css",
"title": "How to simplify your code and avoid repeating your markup with Astrojs and Tailwind CSS",
"link": "https://lexingtonthemes.com/tutorials/how-to-simplify-your-code-and-avoid-repeating-your-markup-with-astrojs-and-tailwind-css/",
"updated": "2024-03-28"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/blog-images-rss.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["images"],
"category": "images",
"title": "Add blog post images to your Astro RSS Feed",
"link": "https://webreaper.dev/posts/astro-rss-feed-blog-post-images/",
"updated": "2023-06-11"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/clerk-react.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["auth"],
"category": "auth",
"title": "Authenticating users in Astro with Clerk and React",
"link": "https://www.launchfa.st/blog/react-astro-clerk",
"updated": "2024-04-12"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/comments-giscus.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["utilities"],
"category": "utilities",
"title": "Add a comments section to your Astro blog using Giscus",
"link": "https://elazizi.com/posts/add-comments-section-to-your-astro-blog/",
"updated": "2023-10-24"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/crowdin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["i18n"],
"category": "i18n",
"title": "How to make your Astro website multilingual with Crowdin: Astro localization guide",
"link": "https://crowdin.com/blog/2023/06/21/astro-localization-and-i18n",
"updated": "2023-06-21"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/dark-mode-tailwindcss.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["css"],
"category": "css",
"title": "Add dark mode to Astro with Tailwind CSS",
"link": "https://www.kevinzunigacuellar.com/blog/dark-mode-in-astro/",
"updated": "2022-05-04"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/data-rss.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["rss"],
"category": "rss",
"title": "How to Send Any Data to Your RSS Feed? A Guide with Astro + RSS",
"link": "https://aritraroy.live/tutorial/blogs/2023/how-to-send-any-data-to-rss-feed/",
"updated": "2023-08-06"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/deploy-astro-aws-amplify.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["deploy"],
"category": "deploy",
"title": "Deploy Astro to AWS Amplify: A Step-by-Step Guide",
"link": "https://www.launchfa.st/blog/deploy-astro-aws-amplify",
"updated": "2024-03-28"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["deploy"],
"category": "deploy",
"title": "Deploy Astro to AWS Elasic Beanstalk: A Step-by-Step Guide",
"link": "https://www.launchfa.st/blog/deploy-astro-aws-elastic-beanstalk",
"updated": "2024-04-08"
Expand Down
2 changes: 1 addition & 1 deletion src/content/resources/deploy-astro-aws-fargate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tags": ["deploy"],
"category": "deploy",
"title": "Deploy Astro to Amazon ECS on AWS Fargate: A Step-by-Step Guide",
"link": "https://www.launchfa.st/blog/deploy-astro-aws-fargate",
"updated": "2024-03-30"
Expand Down
Loading