-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconvert.sh
executable file
·104 lines (88 loc) · 4.42 KB
/
convert.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
set -euo pipefail
# Error handling
handle_error() {
echo "Error: $1"
cleanup
exit 1
}
# Cleanup function
cleanup() {
rm -f header.html template.html
}
# Check requirements
if ! command -v pandoc &> /dev/null; then
handle_error "pandoc is not installed. Please install it first."
fi
# Create template
cat > template.html << 'EOL'
<!DOCTYPE html>
<html lang="en">
<head>
$header-includes$
</head>
<body>
<header role="banner">
<h1 class="title">$title$</h1>
<nav role="navigation" aria-label="Table of contents">
$toc$
</nav>
</header>
<main id="main-content" role="main">
$body$
</main>
<footer role="contentinfo">
<p><a href="https://github.com/fynks/debrid-services-comparison">Source ↗</a> | Made with ❤️ by Fynks</p>
</footer>
<script>
document.addEventListener("DOMContentLoaded",(function(){const e=document.getElementById("available-hosts");if(e){const t=document.createElement("div");t.id="search-container",t.innerHTML='\n <input type="text" id="search-input" placeholder="Search the hosts..." />\n ',e.insertAdjacentElement("afterend",t);const n=document.getElementById("search-input");n.addEventListener("input",(function(){const e=n.value.toLowerCase(),t=document.querySelectorAll("table");if(t.length>1){const n=t[1].getElementsByTagName("tr");for(let t=1;t<n.length;t++){const o=n[t].getElementsByTagName("td");let a=!1;for(let t=0;t<o.length;t++)if(o[t].innerText.toLowerCase().includes(e)){a=!0;break}n[t].style.display=a?"":"none"}}}))}}));
</script>
</body>
</html>
EOL
# Create header with improved meta tags
cat > header.html << 'EOL'
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="../favicon.ico" sizes="any">
<link rel="icon" href="../favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<title>Debrid Services Comparison</title>
<meta name="description" content="A comparison of available hosts and pricing for AllDebrid, Real-Debrid, LinkSnappy, Premiumize, Debrid-Link, TorBox and Mega-Debrid.">
<meta name="keywords" content="debrid services comparison, AllDebrid, Real-Debrid, LinkSnappy, Premiumize, Debrid-Link, TorBox, Mega-Debrid, file hosting, download services, premium downloads, host comparison, pricing comparison, supported hosts, file hosts, download acceleration, premium link generator, download manager">
<meta name="author" content="Fynks">
<meta name="robots" content="index, follow">
<meta name="theme-color" content="#0366d6">
<link rel="stylesheet" href="styles.css">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://debrid-services-comparison.netlify.app/">
<meta property="og:title" content="Debrid Services Comparison Tool">
<meta property="og:description" content="Compare features, pricing, and supported hosts across major debrid services including AllDebrid, Real-Debrid, LinkSnappy, Premiumize, Debrid-Link, TorBox and Mega-Debrid.">
<meta property="og:image" content="https://debrid-services-comparison.netlify.app/image.png">
<meta property="og:site_name" content="Debrid Services Comparison">
<meta property="og:locale" content="en_US">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://debrid-services-comparison.netlify.app/">
<meta property="twitter:title" content="Debrid Services Comparison Tool">
<meta property="twitter:description" content="Compare features, pricing, and supported hosts across major debrid services including AllDebrid, Real-Debrid, LinkSnappy, Premiumize, Debrid-Link, TorBox and Mega-Debrid.">
<meta property="twitter:image" content="https://debrid-services-comparison.netlify.app/image.png">
<meta property="twitter:image:alt" content="Debrid services comparison chart showing features and pricing">
EOL
# Convert markdown with progress
echo "Starting conversion process..."
echo "→ Generating HTML from markdown..."
pandoc README.md \
--from gfm \
--to html5 \
--standalone \
--template=template.html \
--include-in-header=header.html \
--metadata title="Debrid Services Comparison" \
--shift-heading-level-by=-1 \
--toc-depth=2 \
-o docs/index.html || handle_error "Conversion failed"
# Cleanup
cleanup
echo "✓ Conversion complete! Output saved as docs/index.html"