Remove Edit this page on GitHub link from docs layout

This commit is contained in:
codecalm
2026-08-12 01:35:01 +02:00
parent a28b1e1a85
commit 4948c03c34
4 changed files with 8 additions and 21 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@tabler/docs": patch
---
Removed the "Edit this page on GitHub" link and the `editPath` prop from the docs layout.
+2 -19
View File
@@ -34,8 +34,7 @@ interface Props {
/**
* Page URL in the docs namespace, e.g. "/ui/components/alert".
* By default derived from Astro.url.pathname by stripping the /docs prefix.
* Drives the active menu entry, pagination, the "Edit this page" link, and
* the relative favicon path.
* Drives the active menu entry, pagination, and the relative favicon path.
*/
url?: string | undefined;
/** Extra libraries from libs.json (css+js) */
@@ -46,8 +45,6 @@ interface Props {
related?: string[];
/** hides child and previous/next page navigation */
hidePagination?: boolean | undefined;
/** repo-relative source path for the "Edit this page" link, e.g. "docs/content/ui/components/alert.mdx" */
editPath?: string | undefined;
/** url of this page's markdown mirror (see pages/[...slug].md.ts); omitted for pages outside the docs collection */
markdownUrl?: string | undefined;
}
@@ -64,7 +61,6 @@ const {
cssPlugins = [],
related = [],
hidePagination = false,
editPath,
markdownUrl,
} = Astro.props;
@@ -110,11 +106,6 @@ const ogImageUrl = new URL('/static/og.png', Astro.site ?? site.docsUrl).href;
const depth = docsUrl.split('/').filter(Boolean).length;
const relative = depth === 0 ? '.' : '../'.repeat(depth).slice(0, -1);
// Source path for the "Edit this page" link. Prefer the real path passed by the
// route (from the collection entry); fall back to the flat-page convention.
const editFilePath =
editPath ?? (docsUrl === '/' ? 'docs/content/index.mdx' : `docs/content${docsUrl.replace(/\/$/, '')}.mdx`);
// docs-libs + clipboard (always included). In dev, file names stay unchanged
// (e.g. dist/clipboard.min.js keeps .min).
type Lib = { npm?: string; js?: string[]; css?: string[] };
@@ -389,15 +380,7 @@ const relatedPages = await Promise.all(
{!hidePagination && <DocsPagination url={docsUrl} />}
<div class="mt-7">
<div>
<a
href={`${site.githubUrl}/edit/dev/${editFilePath}`}
class="link-primary"
target="_blank" rel="noopener noreferrer"><Icon name="edit" class="icon-inline" /> Edit this page on GitHub</a
>
</div>
<nav class="mt-5" aria-label="Documentation sections">
<nav aria-label="Documentation sections">
<ul class="list-inline list-inline-dots mb-0 text-secondary">
{[
{ title: 'Getting started', url: '/ui/getting-started' },
+1 -1
View File
@@ -14,7 +14,7 @@ const sections = [
]
---
<DocsLayout title="Page not found" summary="The page you are looking for does not exist or has been moved." description="The page you are looking for does not exist. Browse the Tabler documentation sections or use the search." hidePagination url="/404" editPath="docs/pages/404.astro">
<DocsLayout title="Page not found" summary="The page you are looking for does not exist or has been moved." description="The page you are looking for does not exist. Browse the Tabler documentation sections or use the search." hidePagination url="/404">
<p>Check the address for typos, use the search at the top of the page, or start from one of the sections below.</p>
<div class="mt-6">
-1
View File
@@ -39,7 +39,6 @@ const toc = headings.filter((heading) => heading.depth === 2 || heading.depth ==
toc={toc}
url={docsUrlFromId(entry.id)}
markdownUrl={`/${entry.id}.md`}
editPath={entry.filePath ? `docs/${entry.filePath}` : undefined}
>
<Content />
</DocsLayout>