From c466b30e0152d67aa676eb7fd798cc233ebaca65 Mon Sep 17 00:00:00 2001
From: fynks <75840152+fynks@users.noreply.github.com>
Date: Mon, 29 Sep 2025 10:07:33 +0500
Subject: [PATCH] Refactor build-docs script to create pricing.md with support
section preceding pricing section
---
README.md | 19 +++++++++++++------
scripts/build-docs.sh | 31 ++++++++++++++++++++++++++++---
2 files changed, 41 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 7208287..b11fcb3 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@
[(↑ Back to Top)](#table-of-contents)
@@ -148,12 +149,16 @@ Debrid ("multi-hoster") services act as paid aggregation layers between you and
### File Hosts
-
+
+
+
| ⚡ For faster exploration (search + filter + side-by-side), use the
interactive web app. |
|------------------------------------------|
-
+
+
+
| **Service Name** | **AllDebrid** | **TorBox** | **Premiumize** | **Real-Debrid** | **Debrid-Link** | **LinkSnappy** | **Mega-Debrid** | **Deepbrid** | **High-Way** |
@@ -445,7 +450,7 @@ Debrid ("multi-hoster") services act as paid aggregation layers between you and
| **Total = 284** | **70/284** | **104/284** | **31/284** | **40/284** | **45/284** | **19/284** | **118/284** | **80/284** | **16/284** |
-
+

@@ -480,7 +485,9 @@ Service availability and host support can change in real time. Use these officia
| **High-Way** | [high-way.me/pages/status](https://high-way.me/pages/status) |
| **Offcloud** | [https://offcloud.com/list](https://offcloud.com/list) |
-
+
+
+
diff --git a/scripts/build-docs.sh b/scripts/build-docs.sh
index 9c18a1a..3e84007 100755
--- a/scripts/build-docs.sh
+++ b/scripts/build-docs.sh
@@ -115,9 +115,34 @@ adjust_links_for_docs() {
log_info "Adjusted links and image paths in $file"
}
-# 5. Copy div sections to respective docs files
-copy_div_to_docs "support" "docs/index.md"
-copy_div_to_docs "pricing" "docs/pricing.md"
+# 5. Function to create pricing.md with support section first, then pricing section
+create_pricing_with_support() {
+ local target_file="docs/pricing.md"
+ local support_content pricing_content
+
+ # Extract both sections
+ support_content=$(extract_div_content "support")
+ pricing_content=$(extract_div_content "pricing")
+
+ if [ $? -eq 0 ] && [ -n "$support_content" ] && [ -n "$pricing_content" ]; then
+ # Create file with frontmatter + support + pricing
+ {
+ # Keep the original frontmatter
+ head -7 "$target_file"
+ echo ""
+ echo "$support_content"
+ echo ""
+ echo "$pricing_content"
+ } > "${target_file}.tmp" && mv "${target_file}.tmp" "$target_file" || handle_error "Failed creating $target_file with support and pricing content"
+ log_info "Created $target_file with support section before pricing section"
+ adjust_links_for_docs "$target_file"
+ else
+ log_warn "Failed to extract support or pricing content"
+ fi
+}
+
+# Copy div sections to respective docs files
+create_pricing_with_support
copy_div_to_docs "hosts" "docs/hosts.md"
copy_div_to_docs "policies" "docs/policies.md"
copy_div_to_docs "tools" "docs/tools.md"