diff --git a/contributing_libraries.md b/contributing_libraries.md
new file mode 100644
index 0000000000..4223a6f337
--- /dev/null
+++ b/contributing_libraries.md
@@ -0,0 +1,21 @@
+# p5.js Libraries
+
+p5.js welcomes libraries contributed by others! Check out the libraries tutorial for more specifics about how to create one. If you have created a library and would like to have it included in the list, follow the instructions below!
+
+1. Fork the repo
+2. Add a file to the `src/content/libraries` folder named `yourLibraryName.yaml`
+3. Inside it, add the following content:
+ - `name`: The name of the library
+ - `category`: A category that you think best fits your library. Your choices include: `drawing`, `color`, `ui`, `math`, `physics`, `algorithms`, `3d`, `ai-ml-cv`, `animation`, `filters`, `language`, `hardware`, `sound`, `data`, `networking`, `export`, or `utils`.
+ - `description`: A one-sentence description of the library
+ - `author`: An object containing `name`, your name, and `url`, an optional link to your website
+ - `sourceUrl`: A link to the library's source code (e.g. its repo on GitHub or GitLab)
+ - (Optional) `websiteUrl`: A link to a website for the library
+ - (Optional) `npm`: If applicable, the package name for the library on npm
+ - (Optional) `npmFilePath`: A path like `'dist/library.min.js'` if a specific file in the library should be used from npm
+ - `featuredImage`: An object about the preview thumbnail for the library, with `url`, the path to the image in the `src/content/libraries/images` folder, and `altText`, a short description of its contents for screen readers
+ - (Optional) `license`: A string describing the software license of the library. This may be omitted if your package is on npm and has license info there
+4. Add a **1500x1000** image of your library into `src/content/libraries/images`
+5. Submit a pull request and we'll review your submission
+
+We add libraries that are open-source, includes some documentation and examples, and follow our code of conduct.
diff --git a/src/content/libraries/config.ts b/src/content/libraries/config.ts
index 73eaffb1b5..51146c6b3a 100644
--- a/src/content/libraries/config.ts
+++ b/src/content/libraries/config.ts
@@ -1,16 +1,39 @@
import { z, defineCollection } from "astro:content";
import { author, image } from "../shared";
-const categories = ["core", "ar-vr"] as const;
+const categories = [
+ "drawing",
+ "color",
+ "ui",
+ "math",
+ "physics",
+ "algorithms",
+ "3d",
+ "ai-ml-cv",
+ "animation",
+ "filters",
+ "language",
+ "hardware",
+ "sound",
+ "data",
+ "networking",
+ "export",
+ "utils",
+] as const;
export const librariesCollection = defineCollection({
type: "data",
schema: z.object({
name: z.string(),
- description: z.string().optional(),
+ description: z.string(),
category: z.enum(categories),
- url: z.string().url(),
+ sourceUrl: z.string().url(),
+ websiteUrl: z.string().url().optional(),
+ // 1500x1000
featuredImage: image(),
author: author(),
+ license: z.string().optional(),
+ npm: z.string().optional(),
+ npmFilePath: z.string().optional(),
}),
});
diff --git a/src/content/libraries/images/p5.warp.png b/src/content/libraries/images/p5.warp.png
new file mode 100644
index 0000000000..029bf3fa70
Binary files /dev/null and b/src/content/libraries/images/p5.warp.png differ
diff --git a/src/content/libraries/images/p5.xr.png b/src/content/libraries/images/p5.xr.png
new file mode 100644
index 0000000000..7d5783bb27
Binary files /dev/null and b/src/content/libraries/images/p5.xr.png differ
diff --git a/src/content/libraries/p5.warp.yaml b/src/content/libraries/p5.warp.yaml
new file mode 100644
index 0000000000..57b3656dab
--- /dev/null
+++ b/src/content/libraries/p5.warp.yaml
@@ -0,0 +1,12 @@
+name: p5.warp
+description: Fast 3D domain warping using shaders.
+category: 3d
+sourceUrl: https://github.com/davepagurek/p5.warp
+featuredImage:
+ url: p5.warp.png
+ altText: Four images of a 3D airplane twisting upside-down
+author:
+ name: Dave Pagurek
+ url: https://www.davepagurek.com
+npm: p5.warp
+license: MIT
diff --git a/src/content/libraries/example.yaml b/src/content/libraries/p5.xr.yaml
similarity index 53%
rename from src/content/libraries/example.yaml
rename to src/content/libraries/p5.xr.yaml
index 38581a750a..ebaa583154 100644
--- a/src/content/libraries/example.yaml
+++ b/src/content/libraries/p5.xr.yaml
@@ -1,10 +1,14 @@
name: p5.xr
description: A library for creating VR and AR sketches with p5.
-category: ar-vr
-url: https://p5xr.org/
+category: 3d
+sourceUrl: https://github.com/stalgiag/p5.xr
+websiteUrl: https://p5xr.org
featuredImage:
- url: https://github.com/stalgiag/p5.xr/raw/main/docs/assets/xr-tear.png
+ url: p5.xr.png
altText: A crying face
author:
name: Stalgia Grigg
url: https://www.stalgiagrigg.name/
+npm: p5.xr
+npmFilePath: dist/p5xr.min.js
+license: MIT
diff --git a/src/content/shared.ts b/src/content/shared.ts
index a190f849ff..02508951d9 100644
--- a/src/content/shared.ts
+++ b/src/content/shared.ts
@@ -6,7 +6,7 @@ import { z } from "astro:content";
*/
export const image = () =>
z.object({
- url: z.string().url(),
+ url: z.string(), // Not using .url() to allow relative paths
altText: z.string(),
});