From 9f10e4840482a0cbd2c00a91c35e262ff6649048 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 +++-- src/pages/rules/[...slug].astro | 2 +- 2 files changed, 4 insertions(+), 3 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 => { }; --- - +

diff --git a/src/pages/rules/[...slug].astro b/src/pages/rules/[...slug].astro index bf16816b..080b0699 100644 --- a/src/pages/rules/[...slug].astro +++ b/src/pages/rules/[...slug].astro @@ -86,7 +86,7 @@ const description = await stripText(entry.data.excerpt || entry.body); } - + {content && } From 423183a069d003dba428d0cc30d8bd9ef058d9f2 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 2a5339a30dc15a70ee2865a658b8d28db2213e51 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 4f7cbe9c..79fb93fc 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 4847a1cb31e087c7d6a87616cff206119430bb85 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 f4dae43b85d162e3231a5d1d444d7608d9dd7ee2 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 1610f95851091540ccdf02957ada8876e4ffcb82 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 => { }; --- - +