Skip to content

Commit

Permalink
Better edit links
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Jan 19, 2025
1 parent 5079833 commit c5eaffe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/src/pages/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ type Props = CollectionEntry<"docs">;
const post = Astro.props;
const { Content, headings } = await post.render();
const editUrl = `https://github.com/ascorbic/unpic-img/edit/main/docs/src/content/docs/${Astro.props.id}`;
---

<DocsLayout headings={headings} {...post.data}>
<DocsLayout headings={headings} {...post.data} editUrl={editUrl}>
<Content />
</DocsLayout>
7 changes: 6 additions & 1 deletion docs/src/pages/img/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ type Props = CollectionEntry<"docs">;
const post = Astro.props;
const { Content, headings } = await post.render();
const apiHeadings = post.data.includeApi ? await getHeadings() : [];
const editUrl = `https://github.com/ascorbic/unpic-img/edit/main/docs/src/content/img/${Astro.props.id}`;
---

<DocsLayout headings={[...headings, ...apiHeadings]} {...post.data}>
<DocsLayout
headings={[...headings, ...apiHeadings]}
{...post.data}
editUrl={editUrl}
>
<Content />
{post.data.includeApi ? <Api /> : null}
</DocsLayout>

0 comments on commit c5eaffe

Please sign in to comment.