Skip to content

Commit

Permalink
Fix edit page links for astro pages (#1754)
Browse files Browse the repository at this point in the history
  • Loading branch information
khadni authored Feb 9, 2024
1 parent a334db5 commit f0d589d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const baseFrontmatter = z
metadata,
excerpt: z.string().optional(),
datafeedtype: z.string().optional(),
fileExtension: z.string().optional(),
})
.strict()

Expand Down
9 changes: 8 additions & 1 deletion src/layouts/DocsLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down
2 changes: 1 addition & 1 deletion src/pages/chainlink-nodes.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import button from "@chainlink/design-system/button.module.css"
import styles from "@features/landing/styles/EthereumLandingPage.module.css"
---

<DocsLayout frontmatter={{ section: "nodeOperator", title: "Chainlink Nodes" }}>
<DocsLayout frontmatter={{ section: "nodeOperator", title: "Chainlink Nodes", fileExtension: "astro" }}>
<p>
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
Expand Down

0 comments on commit f0d589d

Please sign in to comment.