From f0d589ddd3357c9bb77d2300fdafe5580c91587b Mon Sep 17 00:00:00 2001 From: Karim H <98668332+khadni@users.noreply.github.com> Date: Fri, 9 Feb 2024 15:33:15 +0100 Subject: [PATCH] Fix edit page links for astro pages (#1754) --- src/content/config.ts | 1 + src/layouts/DocsLayout.astro | 9 ++++++++- src/pages/chainlink-nodes.astro | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/content/config.ts b/src/content/config.ts index a744b0ce27f..4fdb3fafd83 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -54,6 +54,7 @@ const baseFrontmatter = z metadata, excerpt: z.string().optional(), datafeedtype: z.string().optional(), + fileExtension: z.string().optional(), }) .strict() diff --git a/src/layouts/DocsLayout.astro b/src/layouts/DocsLayout.astro index 1db05cb5f34..7ddc686b0a7 100644 --- a/src/layouts/DocsLayout.astro +++ b/src/layouts/DocsLayout.astro @@ -28,7 +28,14 @@ const whatsNext = frontmatter.whatsnext const currentPage = new URL(Astro.request.url).pathname -const currentFile = `src/content${currentPage.replace(/\/$/, "")}${frontmatter.isIndex ? "/index" : ""}.mdx` +const fileExtension = frontmatter.fileExtension || "mdx" + +const baseDirectory = fileExtension === "astro" ? "src/pages" : "src/content" + +const currentFile = `${baseDirectory}${currentPage.replace(/\/$/, "")}${ + frontmatter.isIndex ? "/index" : "" +}.${fileExtension}` + const githubEditUrl = CONFIG.GITHUB_EDIT_URL + currentFile const formattedContentTitle = `${frontmatter.title} | ${CONFIG.SITE.title}` diff --git a/src/pages/chainlink-nodes.astro b/src/pages/chainlink-nodes.astro index 8db071996c8..62eea5423fd 100644 --- a/src/pages/chainlink-nodes.astro +++ b/src/pages/chainlink-nodes.astro @@ -4,7 +4,7 @@ import button from "@chainlink/design-system/button.module.css" import styles from "@features/landing/styles/EthereumLandingPage.module.css" --- - +

Operating a Chainlink node allows you to be part of the Chainlink Network, helping developers build hybrid smart contracts, giving them access to real-world data and services. Learn more about Chainlink nodes with our