From 96f9b07d9fc1d9fea142e9a712cadc80b5aea43d Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 27 Dec 2025 19:18:25 +0700 Subject: [PATCH 1/6] Reduce Pagefind weight for RuleEmbed outside rule pages Hopefully prioritizing rule pages --- src/components/markdown/RuleEmbed.astro | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/markdown/RuleEmbed.astro b/src/components/markdown/RuleEmbed.astro index 4eea2881..225d5530 100644 --- a/src/components/markdown/RuleEmbed.astro +++ b/src/components/markdown/RuleEmbed.astro @@ -9,9 +9,10 @@ interface Props { ruleName?: string; ruleId?: number; fields?: RuleFields[] | "All"; + onRulePage?: boolean; } -const { rule: rule, ruleName, ruleId, fields = [] } = Astro.props; +const { rule: rule, ruleName, ruleId, fields = [], onRulePage } = Astro.props; let ruleEntry = rule; @@ -61,7 +62,7 @@ const shouldShowGroup = (groupFields: RuleFields[]): boolean => { }; --- - +

From e60ad0c6206ba785de0fbd9c263896054a295861 Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 27 Dec 2025 19:19:31 +0700 Subject: [PATCH 2/6] Ignore RuleEmbed title on Pagefind Also prioritizing rule pages in case of title being searched, and to avoid duplicates on rule pages --- src/components/markdown/RuleEmbed.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/markdown/RuleEmbed.astro b/src/components/markdown/RuleEmbed.astro index 225d5530..c578ea0b 100644 --- a/src/components/markdown/RuleEmbed.astro +++ b/src/components/markdown/RuleEmbed.astro @@ -64,7 +64,7 @@ const shouldShowGroup = (groupFields: RuleFields[]): boolean => {
-

+

Rule {ruleData.id}:{` `} From 8f3c5d64124bea102a858c7d8908bc2633a58b9f Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 27 Dec 2025 19:21:30 +0700 Subject: [PATCH 3/6] Ignore alert title on Pagefind --- src/components/ui/alert.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx index 77130a28..3c7ec443 100644 --- a/src/components/ui/alert.tsx +++ b/src/components/ui/alert.tsx @@ -31,6 +31,7 @@ const Alert = React.forwardRef< ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} + data-pagefind-ignore {...props} /> )); From f3d0e1948f3d6e39b51539ba62cd8abf36a00c31 Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 27 Dec 2025 19:24:08 +0700 Subject: [PATCH 4/6] Ignore index/list on Pagefind Reduces links to the index, prioritizing the pages itself --- src/components/markdown/RuleEmbedPage.astro | 1 + src/pages/tags/[...slug].astro | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/markdown/RuleEmbedPage.astro b/src/components/markdown/RuleEmbedPage.astro index a96de0a6..cb3fa1f2 100644 --- a/src/components/markdown/RuleEmbedPage.astro +++ b/src/components/markdown/RuleEmbedPage.astro @@ -58,6 +58,7 @@ const rulesForApproved = rules.filter( { depth: 2, slug: "finished", text: "Finished +" }, { depth: 2, slug: "approved", text: "Approved" }, ]} + pagefindIgnore={true} >

Draft+ entries

diff --git a/src/pages/tags/[...slug].astro b/src/pages/tags/[...slug].astro index 0737e911..0cca35af 100644 --- a/src/pages/tags/[...slug].astro +++ b/src/pages/tags/[...slug].astro @@ -18,7 +18,10 @@ const taggedEntries: CollectionEntry<"docs">[] = ( ).filter((entry) => entry.data.tags.includes(tag)); --- - +
    { taggedEntries.map((entry) => ( From ebdfeaedd0f768e52790565b24a79f30ebb0e1c4 Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 27 Dec 2025 21:25:32 +0700 Subject: [PATCH 5/6] Only ignore RuleEmbed title on Pagefind on rule page --- src/components/markdown/RuleEmbed.astro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/markdown/RuleEmbed.astro b/src/components/markdown/RuleEmbed.astro index c578ea0b..fa733d4e 100644 --- a/src/components/markdown/RuleEmbed.astro +++ b/src/components/markdown/RuleEmbed.astro @@ -64,7 +64,10 @@ const shouldShowGroup = (groupFields: RuleFields[]): boolean => {
    -

    +

    Rule {ruleData.id}:{` `} From 8cb74d692b00e131c7a55df9d32d9ba9c3d60936 Mon Sep 17 00:00:00 2001 From: Hans5958 Date: Sat, 27 Dec 2025 22:15:15 +0700 Subject: [PATCH 6/6] Increase Pagefind weight for RuleEmbed outside rule pages --- src/components/markdown/RuleEmbed.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/markdown/RuleEmbed.astro b/src/components/markdown/RuleEmbed.astro index fa733d4e..9c7f26f5 100644 --- a/src/components/markdown/RuleEmbed.astro +++ b/src/components/markdown/RuleEmbed.astro @@ -62,7 +62,7 @@ const shouldShowGroup = (groupFields: RuleFields[]): boolean => { }; --- - +