Skip to content
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,79 @@ Once you collect all information and create a case study, open a pull request. I

A case study becomes publicly available right after merging and rebuilding the website.

# 🌐 Adding Short URLs to the AsyncAPI Website
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never use emojis in headings, they break anchor urls.

Please check the reply in another PR with the same issue


The AsyncAPI website supports **short URLs** through Netlify's redirect system using the `public/_redirects` file.
This feature enables the creation of memorable, easy-to-share links that redirect to longer URLs — improving user experience and making resources more accessible for the community.

Short URLs are useful for:
- Community resources (Slack, GitHub)
- Frequently accessed documentation
- Marketing campaigns and events

---

## ⚙️ How It Works

All redirects are defined in the `public/_redirects` file. This file follows **Netlify’s redirect syntax** and is automatically processed during deployment.

### Existing Examples

| Short URL | Redirects To | Type |
|------------|---------------|------|
| `/slack-invite` | Slack invitation link | Temporary (302) |
| `/modelina` | `/tools/modelina` | Permanent (301) |
| `/generator` | `/tools/generator` | Permanent (301) |
| `/cheatsheet` | GitHub cheatsheet | Permanent (301) |

---

## ✅ When to Create a Short URL

- **Community resources:** Slack, GitHub repositories
- **Frequently accessed tools:** AsyncAPI Studio, Generator, Modelina
- **Docs shortcuts:** Specification, Getting Started, Tutorials
- **Events & campaigns:** Conferences

### Avoid Short URLs For

- Frequently changing internal pages
- Temporary content without clear end dates
- URLs that conflict with existing site routes
- Personal or private organization links
- Already short, self-explanatory URLs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move these sections above instead of lines 226-229, as they repeat the same information


---
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---


## 🪜 How to Add a New Short URL

### Step 1: Plan

1. **Identify the target URL** you want to redirect to.
2. **Choose a descriptive short path** (see naming conventions below).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see naming conventions below

Where? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was above not below 😅

3. **Select the correct redirect type** — permanent (301) or temporary (302).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
3. **Select the correct redirect type** permanent (301) or temporary (302).
3. **Select the appropriate redirect type**, for example, permanent (301) or temporary (302).

4. **Check for conflicts** with existing routes or redirects.

### Step 2: Edit the Redirects File
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some examples would be helpful here


1. Navigate to `public/_redirects`.
2. Find or create an appropriate section (e.g., “Community Resources”).
3. Add your redirect entry using the correct syntax.
4. Include a descriptive comment explaining the redirect’s purpose.

### Step 3: Submit and Test

1. **Create a Pull Request (PR)** with your changes.
2. Add **context in the PR description** — why this short URL is needed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Add **context in the PR description** why this short URL is needed.
2. Add **context in the PR description** describing why this short URL is needed.

3. **Test the redirect** after deployment to staging/production.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have staging env?

4. **Monitor for issues** and update if necessary.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean that the author of a new short url will forever be its maintainer?


---

## 🧩 Redirect Syntax

`/short-path destination-url status-code!`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section should be a part of the step 2 of the guide above


## JSON Schema definitions

All AsyncAPI JSON Schema definition files are being served within the `/definitions/<file>` path. The content is being served from GH, in particular from https://github.com/asyncapi/spec-json-schemas/tree/master/schemas.
Expand Down