Refactor build-docs script to create pricing.md with support section preceding pricing section
This commit is contained in:
parent
b656d4b583
commit
c466b30e01
2 changed files with 41 additions and 9 deletions
19
README.md
19
README.md
|
|
@ -18,7 +18,7 @@
|
|||
<p><strong>Quick Jump:</strong> <a href="#pricing-comparison">Pricing</a> · <a href="#available-hosts">Hosts</a> · <a href="#policies-and-legal">Policies</a> · <a href="#tools-and-community">Tools</a></p>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<br />
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
|
@ -135,7 +135,8 @@ Debrid ("multi-hoster") services act as paid aggregation layers between you and
|
|||
|
||||

|
||||
|
||||
<br>
|
||||
<br />
|
||||
|
||||
<div align="right">
|
||||
|
||||
[(↑ Back to Top)](#table-of-contents)
|
||||
|
|
@ -148,12 +149,16 @@ Debrid ("multi-hoster") services act as paid aggregation layers between you and
|
|||
|
||||
### File Hosts
|
||||
|
||||
<br><div align="center">
|
||||
<br />
|
||||
|
||||
<div align="center">
|
||||
|
||||
| ⚡ For faster exploration (search + filter + side-by-side), use the <a href="https://debridcompare.pages.dev" target="_blank" rel="noopener">interactive web app</a>. |
|
||||
|------------------------------------------|
|
||||
|
||||
</div><br>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
| **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** |
|
||||
|
||||
|
||||
<br>
|
||||
<br />
|
||||
|
||||

|
||||
|
||||
|
|
@ -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) |
|
||||
|
||||
</details><br>
|
||||
</details>
|
||||
|
||||
<br />
|
||||
|
||||
<div align="right">
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue