Skip to content

Commit 3b18efe

Browse files
committed
Add smart download links & exclude docs from source zip
1 parent b475ed6 commit 3b18efe

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs/ export-ignore
2+
.gitattributes export-ignore

docs/portable/index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Downloading Portable...</title>
6+
<script>
7+
const user = 'M-Rajabi-dev';
8+
const repo = 'AudioShelf';
9+
const filePattern = '-Portable.zip';
10+
11+
fetch(`https://api.github.com/repos/${user}/${repo}/releases/latest`)
12+
.then(response => response.json())
13+
.then(data => {
14+
const asset = data.assets.find(a => a.name.endsWith(filePattern));
15+
if (asset) window.location.href = asset.browser_download_url;
16+
else document.body.innerHTML = "Portable file not found.";
17+
})
18+
.catch(err => { document.body.innerHTML = "Error: " + err; });
19+
</script>
20+
</head>
21+
<body><p>Starting Portable Download...</p></body>
22+
</html>

docs/setup/index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Downloading Setup...</title>
6+
<script>
7+
const user = 'M-Rajabi-dev';
8+
const repo = 'AudioShelf';
9+
const filePattern = '-Setup.exe';
10+
11+
fetch(`https://api.github.com/repos/${user}/${repo}/releases/latest`)
12+
.then(response => response.json())
13+
.then(data => {
14+
const asset = data.assets.find(a => a.name.endsWith(filePattern));
15+
if (asset) window.location.href = asset.browser_download_url;
16+
else document.body.innerHTML = "Setup file not found.";
17+
})
18+
.catch(err => { document.body.innerHTML = "Error: " + err; });
19+
</script>
20+
</head>
21+
<body><p>Starting Setup Download...</p></body>
22+
</html>

0 commit comments

Comments
 (0)