From 9f4657ea5281ceab5d651dc9524aa17788b76794 Mon Sep 17 00:00:00 2001 From: Pranjali Date: Thu, 19 Feb 2026 11:50:48 +0530 Subject: [PATCH 1/9] added main --- src/components/Page/Page.jsx | 52 +++++++++--------------------------- 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/src/components/Page/Page.jsx b/src/components/Page/Page.jsx index cb307fec2524..fc26988f3a2b 100644 --- a/src/components/Page/Page.jsx +++ b/src/components/Page/Page.jsx @@ -25,13 +25,11 @@ export default function Page(props) { } = props; const isDynamicContent = props.content instanceof Promise; - const [dynamicContent, setContent] = useState( - isDynamicContent ? placeholderString() : null, + const [content, setContent] = useState( + isDynamicContent + ? placeholderString() + : () => props.content.default || props.content, ); - const content = isDynamicContent - ? dynamicContent - : props.content.default || props.content; - const [contentLoaded, setContentLoaded] = useState(!isDynamicContent); useEffect(() => { @@ -46,7 +44,6 @@ export default function Page(props) { }, [props.content]); const { hash, pathname } = useLocation(); - const isBlogIndex = pathname === "/blog/"; useEffect(() => { let observer; @@ -55,15 +52,13 @@ export default function Page(props) { const target = document.querySelector("#md-content"); // two cases here // 1. server side rendered page, so hash target is already there - // Note: Why this change because we use getElementById instead of querySelector(hash) here because - // CSS selectors cannot start with a digit (e.g. #11-in-scope is invalid) - if (document.getElementById(hash.slice(1))) { - document.getElementById(hash.slice(1)).scrollIntoView(); + if (document.querySelector(hash)) { + document.querySelector(hash).scrollIntoView(); } else { // 2. dynamic loaded content // we need to observe the dom change to tell if hash exists observer = new MutationObserver(() => { - const element = document.getElementById(hash.slice(1)); + const element = document.querySelector(hash); if (element) { element.scrollIntoView(); } @@ -104,12 +99,10 @@ export default function Page(props) { ); } return ( -
+
+

{title}

- {rest.date && pathname.startsWith("/blog/") && !isBlogIndex && ( -
{rest.date}
- )} {rest.thirdParty ? (
@@ -122,27 +115,6 @@ export default function Page(props) {
{contentRender}
- {rest.url === "/blog/" && ( -
- {(props.pages || []) - .filter((post) => post.url !== "/blog/") - .map((post) => ( -
-

- {post.title} -

- {post.date && ( -
{post.date}
- )} -

{post.teaser}

- - Read More → - -
- ))} -
- )} - {loadRelated && (

Further Reading

@@ -158,7 +130,7 @@ export default function Page(props) { - {!isBlogIndex && (previous || next) && ( + {(previous || next) && ( )} @@ -172,7 +144,8 @@ export default function Page(props) {
)} -
+
+ ); } @@ -182,7 +155,6 @@ Page.propTypes = { related: PropTypes.array, previous: PropTypes.object, next: PropTypes.object, - pages: PropTypes.array, content: PropTypes.oneOfType([ PropTypes.string, PropTypes.func, From 879a197c8fed14e0c2818d21c9089dc20b3e3fe8 Mon Sep 17 00:00:00 2001 From: Pranjali Date: Thu, 19 Feb 2026 12:28:55 +0530 Subject: [PATCH 2/9] revert: remove unintended Page.jsx changes from PR --- src/components/Page/Page.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/Page/Page.jsx b/src/components/Page/Page.jsx index fc26988f3a2b..d46f80503bf4 100644 --- a/src/components/Page/Page.jsx +++ b/src/components/Page/Page.jsx @@ -100,7 +100,6 @@ export default function Page(props) { } return (
-

{title}

@@ -144,7 +143,6 @@ export default function Page(props) { )}
-
); } From 2a5bc72eea1f3c953017994beb9e845713236ba6 Mon Sep 17 00:00:00 2001 From: Pranjali Date: Thu, 19 Feb 2026 13:45:26 +0530 Subject: [PATCH 3/9] revert: remove unintended changes from PR --- .../remark-custom-asides/__snapshots__/index.test.mjs.snap | 2 +- src/remark-plugins/remark-custom-asides/index.mjs | 4 ++-- src/remark-plugins/remark-custom-asides/index.test.mjs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/remark-plugins/remark-custom-asides/__snapshots__/index.test.mjs.snap b/src/remark-plugins/remark-custom-asides/__snapshots__/index.test.mjs.snap index fed7d91e4e55..8c48ad1756b4 100644 --- a/src/remark-plugins/remark-custom-asides/__snapshots__/index.test.mjs.snap +++ b/src/remark-plugins/remark-custom-asides/__snapshots__/index.test.mjs.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing exports[`customize blockquote should transform W> into aside of warning 1`] = ` -" +" " `; diff --git a/src/remark-plugins/remark-custom-asides/index.mjs b/src/remark-plugins/remark-custom-asides/index.mjs index 6b41957135d2..5bb8588b935d 100644 --- a/src/remark-plugins/remark-custom-asides/index.mjs +++ b/src/remark-plugins/remark-custom-asides/index.mjs @@ -37,11 +37,11 @@ export default function remarkCustomAsides( // remove custom characters from paragraph node.children = [ { - type: "paragraph", + type: "heading", + depth: 6, data: { // see https://github.com/syntax-tree/mdast-util-to-hast#hname // add a className to heading - hName: "p", hProperties: { className: `${className}__prefix`, }, diff --git a/src/remark-plugins/remark-custom-asides/index.test.mjs b/src/remark-plugins/remark-custom-asides/index.test.mjs index fac324627734..731e4b5040ce 100644 --- a/src/remark-plugins/remark-custom-asides/index.test.mjs +++ b/src/remark-plugins/remark-custom-asides/index.test.mjs @@ -20,7 +20,7 @@ W> hello world (err, { value: contents }) => { expect(err).toBeUndefined(); expect(contents).toContain('