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

Add Edit in Editor button example #11

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions src/content/docs/examples/edit-in-editor-button.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Edit in editor button
description: An override that replaces the default edit link with a button to edit the current page in your editor
---

import StackBlitz from "../../../components/StackBlitz.astro";

This example demonstrates a custom [`<EditLink>` component override](https://starlight.astro.build/reference/overrides/#editlink) that replaces the default edit link with a button to edit the current page in your editor while in development mode.

This feature relies on the [`launch-editor-middleware`](https://github.com/yyx990803/launch-editor#middleware) exposed by Vite.

<StackBlitz
projectId="github-mydczx"
options={{
openFile: "astro.config.mjs,src/components/EditInEditor.astro",
}}
/>