Commit Graph
9 Commits
Author SHA1 Message Date
Sean Oliver 845ed5a1e3 feat(kb): add cookie consent banner (#52342)
## Problem

kb has no cookie consent banner, so PostHog pageviews have to wait. Part
of GROWTH-1352.

## Solution

- `ConsentIsland` mounts the www/docs consent toast as a `client:only`
island.
- Shared consent code reads `process.env.NEXT_PUBLIC_*`, which Vite
doesn't provide in the browser, so `astro.config.mjs` defines it for the
client only.
- `consent.tsx`, `ConsentToast`, and `PrivacySettings` import specific
`common` modules instead of the barrel, which cuts the island from 652
KB to 96 KB.
- A footer Privacy Settings link opens the same dialog, like docs.

<img width="400" height="150" alt="kb-consent-banner"
src="https://github.com/user-attachments/assets/c32a57ce-89e9-4842-89e4-67d03dafcd7c"
/>

kb previews auto-accept consent like www and docs
(`NEXT_PUBLIC_ENVIRONMENT=staging`). Production needs
`NEXT_PUBLIC_IS_PLATFORM` and `NEXT_PUBLIC_USERCENTRICS_RULESET_ID`
before the banner shows.

Testing: on `astro dev` (toast forced on), the banner renders, and
Privacy settings opens from both the toast and the footer. Accept and
opt out are unverified until production.

## Review instructions

1. The kb, www, and docs previews load with no console errors.
2. On the kb preview, the footer Privacy Settings link opens the dialog.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-27 15:36:15 -07:00
Anthony Lio 8bcbe3dcc7 feat(docs): extracts code block component (#51661)
## Problem

new surfaces display code blocks their own way while docs has the full
implementation but it lives inside `apps/docs`


## Solution

- moves the docs code block parts to `ui-patterns/CodeBlock` as separate
imports
- kb code blocks now show line numbers, which matches docs

| state | preview |
| -------|------|
| before | <img width="913" height="509" alt="image"
src="https://github.com/user-attachments/assets/76ff0096-433a-4b06-9eca-1d79c4940e24"
/> |
| after | <img width="913" height="509" alt="image"
src="https://github.com/user-attachments/assets/4f5d91d9-13df-44a0-9e65-edf605773c5f"
/> |

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

1. visit /[docs/guides/database/tables#enabling-row-level-security
](https://docs-git-feat-shared-code-block-parts-supabase.vercel.app/docs/guides/database/tables#enabling-row-level-security)code
blocks, line numbers, colors in light and dark mode, copy, and word wrap
match
2. visit
[/docs/guides/auth/passwords](https://docs-git-feat-shared-code-block-parts-supabase.vercel.app/docs/guides/auth/passwords)
hover over a typed identifier tooltip should still show
3. visit a kb guide with code, for example
[/kb/guides/migrate-from-mysql](https://kb-git-feat-shared-code-block-parts-supabase.vercel.app/kb/guides/migrate-from-mysql)
4. visit the [design system code block
page](https://design-system-git-feat-shared-code-block-parts-supabase.vercel.app/design-system/docs/fragments/code-block)

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-22 11:46:38 +03:00
Kody Jackson 8b3c47006e chore(Kb) - sitemap fix (#52044)
## Problem

KB sitemap referred to slashed entries, even though our convention is
unslashed entries.
(discovered by @nrichers in #52017)

## Solution

Configure the Astro project to [never support trailing
slashes](https://docs.astro.build/en/reference/configuration-reference/#trailingslash)
(fixes sitemap) + the [Vercel
config](https://vercel.com/docs/project-configuration/vercel-json#trailingslash)
to always redirect trailing slashes to their unslashed entities.

The vercel config here might be overkill... but doesn't hurt imo.

There's a weird bug in the Astro sitemap extension where the root entry
stays slashed `/kb/`, but everything else is now correct.

## Preview links


[sitemap](https://kb-git-kb-sitemap-fix-supabase.vercel.app/kb/sitemap-0.xml)

| slashed | unslashed |
| [homepage]() | [homepage]() |
|
[troubleshooting](https://kb-git-kb-sitemap-fix-supabase.vercel.app/kb/troubleshooting/error-invalid-byte-sequence-for-encoding-utf8-0x00-when-accessing-triggers-or-webhooks)
|
[troubleshooting](https://kb-git-kb-sitemap-fix-supabase.vercel.app/kb/troubleshooting/error-invalid-byte-sequence-for-encoding-utf8-0x00-when-accessing-triggers-or-webhooks/)
|
|
[guides](https://kb-git-kb-sitemap-fix-supabase.vercel.app/kb/guides/migrate-from-firebase-storage)
|
[guides](https://kb-git-kb-sitemap-fix-supabase.vercel.app/kb/guides/migrate-from-firebase-storage/)
|
2026-10-21 08:02:49 -05:00
Jeremias Menichelli 05396e3378 [DOCS-1422] feat: create GitHub workflow or script to fetch troubleshooting (#51365)
## Problem

Currently troubleshooting guides merged in a private repository trigger
an action to open a PR against our Docs project.

From now on, we want the `kb` to host the troubleshooting guides and
take care of all the Github discussion process while improving some of
its parts.

## Solution

With this PR now:
- All files and scripts related to handling the actions and processes
for handling troubleshooting entries and GitHub Discussion creation on
Docs are deleted.
- A new workflow to sync troubleshooting guides with Supabase's
`troubleshooting_entries` table was created with some improvements.
- Now troubleshooting entries are fetched at pre-build in `kb` project
directory.
- When troubleshooting guides are created a new script detects this,
creates the GitHub discussion for it, extracts the URL, and pushes the
row to a db table at `push`.
- When troubleshooting guides are updated, a checksum holding its title
and body is compared, and the GitHub discussion content gets updated.
 
_Note: all troubleshooting content hasn't been migrated for **kb**, so
content not ready is filtered and not placed in the directory. This
allow us to progressively migrate all pages without breaking the build._

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

For the database workflow, sadly, we will have to wait and monitor, but
the fetching mechanism can be tested.

1. Go to the preview link for `kb`
2. Go to Topics > Troubleshooting
3. A new guide should be visible "Partial migrations and schema
inconsistencies from embedded transactions", click on its link
4. A page showing the guide's content should render

<img width="1022" height="810" alt="Screenshot 2026-10-07 at 13 19 17"
src="https://github.com/user-attachments/assets/cbd25a60-8721-4329-907f-f92de894c217"
/>



## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-13 14:30:58 -03:00
Kody JacksonandIvan Vasilov ce2f1da065 feat(kb) - Add sitemap (#51132)
Adds a sitemap file to the new KB.

## Preview links

https://kb-git-kb-seo-conventions-supabase.vercel.app/kb/

## Review instructions

On the preview, check the following paths:

-
[`/sitemap-index.xml`](https://kb-git-kb-seo-conventions-supabase.vercel.app/kb/sitemap-index.xml)
and
[`/sitemap-0.xml`](https://kb-git-kb-seo-conventions-supabase.vercel.app/kb//sitemap-0.xml)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* A sitemap is now generated for the knowledge base and linked from its
pages. Its URL reflects the site’s configured base path, so the link
points to the correct location across different deployment paths.
Existing content and page functionality remain unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-10-02 09:40:24 -05:00
Jeremias Menichelli a78472ba7c chore: Add support for admonition in gfm alert notation (#50093) 2026-09-10 12:31:43 +02:00
Jeremias Menichelli 0ab0bb8efd feat(kb): Apply supabase theme to code blocks (#49957) 2026-09-07 12:40:09 +02:00
Jeremias Menichelli dd57c1476f chore: Add redirects to www for kb project (#49780) 2026-09-02 12:26:38 +02:00
Jeremias Menichelli 143f141e0f feat: initial kb scaffolding (#49601) 2026-08-31 14:55:04 +00:00