From 9de9b121a4f28862b6c53a59daa599d3b3df7093 Mon Sep 17 00:00:00 2001 From: goose Date: Sat, 5 Oct 2024 18:16:00 +0700 Subject: [PATCH] feature: add edit suggestion links --- src/components/GithubLogo.astro | 11 +++++++++ src/components/PartHeading.astro | 23 +++++++++++++++---- src/pages/btree-under-a-microscope/basics.mdx | 6 ++++- .../btree-under-a-microscope/databases.mdx | 6 ++++- .../optimizations.mdx | 6 ++++- .../btree-under-a-microscope/variations.mdx | 6 ++++- 6 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 src/components/GithubLogo.astro diff --git a/src/components/GithubLogo.astro b/src/components/GithubLogo.astro new file mode 100644 index 0000000..ff865d6 --- /dev/null +++ b/src/components/GithubLogo.astro @@ -0,0 +1,11 @@ +--- +const { class: className } = Astro.props +--- + + + + diff --git a/src/components/PartHeading.astro b/src/components/PartHeading.astro index 2b1c533..8557bff 100644 --- a/src/components/PartHeading.astro +++ b/src/components/PartHeading.astro @@ -1,13 +1,26 @@ --- +import GithubLogo from './GithubLogo.astro' + type Props = { part: number text: string + githubLink?: string } -const { part, text } = Astro.props +const { part, text, githubLink } = Astro.props --- -

-
Part {part}
-
{text}
-

+
+

+
Part {part}
+
{text}
+

+ + { + githubLink && + } +
diff --git a/src/pages/btree-under-a-microscope/basics.mdx b/src/pages/btree-under-a-microscope/basics.mdx index 7b5f7ca..ff3b685 100644 --- a/src/pages/btree-under-a-microscope/basics.mdx +++ b/src/pages/btree-under-a-microscope/basics.mdx @@ -40,7 +40,11 @@ import plainBtree from '@images/plain-btree.png'; - + The one thing I love about B-Tree is that the core idea is crazy simple. I can't help myself nodding enthusiastically while reading about it: "Hmm, this diff --git a/src/pages/btree-under-a-microscope/databases.mdx b/src/pages/btree-under-a-microscope/databases.mdx index b3b37fe..4b87c52 100644 --- a/src/pages/btree-under-a-microscope/databases.mdx +++ b/src/pages/btree-under-a-microscope/databases.mdx @@ -49,7 +49,11 @@ import slottedPageFragmentation from '@images/slotted-page-fragmentation.png'; - + B-Tree is ubiquitous and appears everywhere, especially in the database realm. You can find a B-Tree implementation in almost every database nowadays, diff --git a/src/pages/btree-under-a-microscope/optimizations.mdx b/src/pages/btree-under-a-microscope/optimizations.mdx index 1e0c41c..1b56465 100644 --- a/src/pages/btree-under-a-microscope/optimizations.mdx +++ b/src/pages/btree-under-a-microscope/optimizations.mdx @@ -35,7 +35,11 @@ import slottedPage from '@images/slotted-page.png'; - + We can apply a number of optimizations on the baseline design of B-Tree, each with different trade-offs. They aim to provide more compact tree diff --git a/src/pages/btree-under-a-microscope/variations.mdx b/src/pages/btree-under-a-microscope/variations.mdx index 146c02b..29bb96a 100644 --- a/src/pages/btree-under-a-microscope/variations.mdx +++ b/src/pages/btree-under-a-microscope/variations.mdx @@ -33,7 +33,11 @@ import bLinkTree from '@images/b-link-tree.png'; - + B-Tree has different variations, improving different aspects of the base design. They all share a few things in common: tree structure, the balancing mechanism