Skip to content

Commit 2d3f861

Browse files
Merge branch 'main' into gfletcher-cll-remix
2 parents 3131821 + d14c612 commit 2d3f861

File tree

10 files changed

+75
-105
lines changed

10 files changed

+75
-105
lines changed

src/components/LeftSidebar/RecursiveSidebar.astro

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ function removeSlashes(url: string): string {
2020
return sanitizedUrl
2121
}
2222
23+
/** Checks if the URL is external (starts with http:// or https://) */
24+
function isExternalUrl(url: string): boolean {
25+
return url.startsWith("http://") || url.startsWith("https://")
26+
}
27+
28+
/** Builds the correct href based on whether the URL is internal or external */
29+
function buildHref(url: string): string {
30+
if (isExternalUrl(url)) {
31+
return url // Return external URLs as-is
32+
}
33+
return `${Astro.site?.pathname}${url}` // Prepend base path for internal URLs
34+
}
35+
2336
/**
2437
* Determines if a page matches the current page or should be highlighted.
2538
* Handles:
@@ -29,6 +42,9 @@ function removeSlashes(url: string): string {
2942
function isCurrentPageMatch(sectionUrl: string, currentPage: string, highlightAsCurrent: string[] = []): boolean {
3043
if (!sectionUrl) return false
3144
45+
// External URLs should never match the current page
46+
if (isExternalUrl(sectionUrl)) return false
47+
3248
const normalizedSectionUrl = removeSlashes(sectionUrl)
3349
const normalizedCurrentPage = removeSlashes(currentPage.slice(1))
3450
@@ -51,6 +67,12 @@ function isCurrentPageMatch(sectionUrl: string, currentPage: string, highlightAs
5167
*/
5268
function shouldExpandSection(item: SectionContent, currentPage: string): boolean {
5369
const normalizedCurrentPage = removeSlashes(currentPage.slice(1))
70+
71+
// For external URLs, we don't need to expand the section
72+
if (item.url && isExternalUrl(item.url)) {
73+
return false
74+
}
75+
5476
const normalizedItemUrl = item.url ? removeSlashes(item.url) : ""
5577
5678
// If this item has a URL, check if the current page is this item or a descendant
@@ -87,8 +109,10 @@ function shouldExpandSection(item: SectionContent, currentPage: string): boolean
87109
{item.url ? (
88110
<a
89111
class={isCurrentPageMatch(item.url, currentPage, item.highlightAsCurrent) ? styles.active : ""}
90-
href={`${Astro.site?.pathname}${item.url}`}
112+
href={buildHref(item.url)}
91113
aria-current={isCurrentPageMatch(item.url, currentPage, item.highlightAsCurrent) ? "page" : "false"}
114+
target={isExternalUrl(item.url) ? "_blank" : undefined}
115+
rel={isExternalUrl(item.url) ? "noopener noreferrer" : undefined}
92116
>
93117
{item.title}
94118
</a>
@@ -103,8 +127,10 @@ function shouldExpandSection(item: SectionContent, currentPage: string): boolean
103127
) : (
104128
<a
105129
class={`${styles.navLink} ${isCurrentPageMatch(item.url, currentPage, item.highlightAsCurrent) ? styles.active : ""}`}
106-
href={`${Astro.site?.pathname}${item.url}`}
130+
href={buildHref(item.url)}
107131
aria-current={isCurrentPageMatch(item.url, currentPage, item.highlightAsCurrent) ? "page" : "false"}
132+
target={isExternalUrl(item.url) ? "_blank" : undefined}
133+
rel={isExternalUrl(item.url) ? "noopener noreferrer" : undefined}
108134
>
109135
{item.title}
110136
</a>

src/config/sidebar.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
105105
title: "Flags Contract Registry",
106106
url: "data-feeds/contract-registry",
107107
},
108+
{
109+
title: "Release Notes",
110+
url: "https://dev.chain.link/changelog?product=Data+Feeds",
111+
},
108112
],
109113
},
110114
{
@@ -295,7 +299,7 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
295299
},
296300
{
297301
title: "Release Notes",
298-
url: "data-streams/release-notes",
302+
url: "https://dev.chain.link/changelog?product=Data+Streams",
299303
},
300304
],
301305
},
@@ -527,14 +531,14 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
527531
title: "Service Limits",
528532
url: "chainlink-automation/overview/service-limits",
529533
},
530-
{
531-
title: "Release Notes",
532-
url: "chainlink-automation/overview/automation-release-notes",
533-
},
534534
{
535535
title: "Migrate to Automation v2.1",
536536
url: "chainlink-automation/guides/migrate-to-v2",
537537
},
538+
{
539+
title: "Release Notes",
540+
url: "https://dev.chain.link/changelog?product=Automation",
541+
},
538542
],
539543
},
540544
{
@@ -712,7 +716,7 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
712716
},
713717
{
714718
title: "Release Notes",
715-
url: "chainlink-functions/resources/release-notes",
719+
url: "https://dev.chain.link/changelog?product=Functions",
716720
},
717721
],
718722
},
@@ -911,7 +915,7 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
911915
},
912916
{
913917
title: "Release Notes",
914-
url: "vrf/release-notes",
918+
url: "https://dev.chain.link/changelog?product=VRF",
915919
},
916920
],
917921
},
@@ -1092,7 +1096,7 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
10921096
},
10931097
{
10941098
title: "Release Notes",
1095-
url: "ccip/release-notes",
1099+
url: "https://dev.chain.link/changelog?product=CCIP",
10961100
},
10971101
],
10981102
},
@@ -1576,10 +1580,6 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
15761580
title: "Overview",
15771581
url: "chainlink-nodes",
15781582
},
1579-
{
1580-
title: "Release Notes",
1581-
url: "chainlink-nodes/node-versions",
1582-
},
15831583
{
15841584
title: "Run a Chainlink Node",
15851585
url: "chainlink-nodes/v1/running-a-chainlink-node",
@@ -1606,6 +1606,10 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
16061606
title: "System Requirements",
16071607
url: "chainlink-nodes/resources/requirements",
16081608
},
1609+
{
1610+
title: "Release Notes",
1611+
url: "https://dev.chain.link/changelog?product=Nodes",
1612+
},
16091613
],
16101614
},
16111615
{

src/content/ccip/release-notes.mdx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/content/chainlink-automation/concepts/best-practice.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Alternatively, set the forwarder address when your upkeep is deployed and read t
3232

3333
### Use the Forwarder
3434

35-
If your upkeep performs **sensitive** functions in your protocol, consider using the [`Forwarder`](/chainlink-automation/overview/automation-release-notes) to lock it down so `performUpkeep` can only be called by the `Forwarder`. Add other permissible addresses if you need to call it yourself. Note the forwarder is only determined after registration so make this a mutable variable and ensure you add a setter function with permissions for you to set it.
35+
If your upkeep performs **sensitive** functions in your protocol, consider using the `Forwarder` to lock it down so `performUpkeep` can only be called by the `Forwarder`. Add other permissible addresses if you need to call it yourself. Note the forwarder is only determined after registration so make this a mutable variable and ensure you add a setter function with permissions for you to set it.
3636

3737
### Verify Data Streams reports fetched with StreamsLookup
3838

src/content/chainlink-automation/overview/automation-release-notes.mdx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/content/chainlink-functions/resources/release-notes.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/content/chainlink-nodes/node-versions.mdx

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/content/data-streams/release-notes.mdx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/content/vrf/release-notes.mdx

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/features/redirects/redirects.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,6 +2309,36 @@
23092309
"source": "data-feeds/feed-registry/feed-registry-functions",
23102310
"destination": "data-feeds",
23112311
"statusCode": 301
2312+
},
2313+
{
2314+
"source": "data-streams/release-notes",
2315+
"destination": "https://dev.chain.link/changelog?product=Data+Streams",
2316+
"statusCode": 301
2317+
},
2318+
{
2319+
"source": "ccip/release-notes",
2320+
"destination": "https://dev.chain.link/changelog?product=CCIP",
2321+
"statusCode": 301
2322+
},
2323+
{
2324+
"source": "chainlink-automation/overview/automation-release-notes",
2325+
"destination": "https://dev.chain.link/changelog?product=Automation",
2326+
"statusCode": 301
2327+
},
2328+
{
2329+
"source": "chainlink-functions/resources/release-notes",
2330+
"destination": "https://dev.chain.link/changelog?product=Functions",
2331+
"statusCode": 301
2332+
},
2333+
{
2334+
"source": "vrf/release-notes",
2335+
"destination": "https://dev.chain.link/changelog?product=VRF",
2336+
"statusCode": 301
2337+
},
2338+
{
2339+
"source": "chainlink-nodes/node-versions",
2340+
"destination": "https://dev.chain.link/changelog?product=Nodes",
2341+
"statusCode": 301
23122342
}
23132343
]
23142344
}

0 commit comments

Comments
 (0)