1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Added download badges

This commit is contained in:
Laurent Cozic 2017-11-20 22:28:22 +00:00
parent 8d8395c226
commit ab8115b89d
9 changed files with 10 additions and 56 deletions

1
.gitignore vendored
View File

@ -34,3 +34,4 @@ sync_staging.sh
_vieux/
_mydocs
.DS_Store
Assets/DownloadBadges*.psd

View File

@ -57,9 +57,9 @@ async function main() {
let content = readmeContent();
if (winUrl) content = content.replace(/(\(https:\/\/github.com\/laurent22\/joplin\/releases\/download\/.*?\.exe\))/, '(' + winUrl + ')');
if (macOsUrl) content = content.replace(/(\(https:\/\/github.com\/laurent22\/joplin\/releases\/download\/.*?\.dmg\))/, '(' + macOsUrl + ')');
if (linuxUrl) content = content.replace(/(\(https:\/\/github.com\/laurent22\/joplin\/releases\/download\/.*?\.AppImage\))/, '(' + linuxUrl + ')');
if (winUrl) content = content.replace(/(https:\/\/github.com\/laurent22\/joplin\/releases\/download\/.*?\.exe)/, winUrl);
if (macOsUrl) content = content.replace(/(https:\/\/github.com\/laurent22\/joplin\/releases\/download\/.*?\.dmg)/, macOsUrl);
if (linuxUrl) content = content.replace(/(https:\/\/github.com\/laurent22\/joplin\/releases\/download\/.*?\.AppImage)/, linuxUrl);
setReadmeContent(content);
}

View File

@ -1,47 +0,0 @@
'use strict';
const fs = require('fs-extra');
const https = require('https');
const request = require('request');
const url = 'https://api.github.com/repos/laurent22/joplin/releases/latest';
async function gitHubLatestRelease() {
return new Promise((resolve, reject) => {
request.get({
url: url,
json: true,
headers: {'User-Agent': 'Joplin Readme Updater'}
}, (error, response, data) => {
if (err) {
reject(error);
} else if (response.statusCode !== 200) {
reject(new Error('Error HTTP ' + response.statusCode));
} else {
resolve(data);
}
});
});
}
function downloadUrl(release, os) {
if (!release || !release.assets || !release.assets.length) return null;
for (let i = 0; i < release.assets.length; i++) {
const asset = release.assets[i];
const name = asset.name;
if (name.indexOf('.dmg') > 0 && os === 'macos') return asset.browser_download_url;
}
}
async function main() {
const release = await gitHubLatestRelease();
console.info(downloadUrl(release, 'windows'));
console.info(downloadUrl(release, 'macos'));
console.info(downloadUrl(release, 'linux'));
}
main().catch((error) => {
console.error('Fatal error', error);
});

View File

@ -18,16 +18,16 @@ Three types of applications are available: **desktop** (Windows, macOS and Linux
Operating system | Link
-----------------|--------
Windows | [Download Joplin for Windows](https://github.com/laurent22/joplin/releases/download/v0.10.20/Joplin-Setup-0.10.20.exe)
macOS | [Download Joplin for macOS](https://github.com/laurent22/joplin/releases/download/v0.10.20/Joplin-0.10.20.dmg)
Linux | [Download Joplin for Linux](https://github.com/laurent22/joplin/releases/download/v0.10.20/Joplin-0.10.20-x86_64.AppImage)
Windows | <a href='https://github.com/laurent22/joplin/releases/download/v0.10.22/Joplin-Setup-0.10.22.exe'><img alt='Get it on Windows' height="60px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeWindows.png'/></a>
macOS | <a href='https://github.com/laurent22/joplin/releases/download/v0.10.22/Joplin-0.10.22.dmg'><img alt='Get it on macOS' height="60px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeMacOS.png'/></a>
Linux | <a href='https://github.com/laurent22/joplin/releases/download/v0.10.22/Joplin-0.10.22-x86_64.AppImage'><img alt='Get it on macOS' height="60px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeLinux.png'/></a>
## Mobile applications
Operating system | Link
-----------------|--------
Android | <a href='https://play.google.com/store/apps/details?id=net.cozic.joplin&utm_source=GitHub&utm_campaign=README&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="60px" src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png'/></a>
iOS | Coming soon!
Android | <a href='https://play.google.com/store/apps/details?id=net.cozic.joplin&utm_source=GitHub&utm_campaign=README&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' height="60px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeAndroid.png'/></a>
iOS | <a href='#'><img alt='Get it on the App Store' height="60px" src='https://raw.githubusercontent.com/laurent22/joplin/master/docs/images/BadgeIOS.png'/></a>
## Terminal application

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
docs/images/BadgeIOS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
docs/images/BadgeLinux.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
docs/images/BadgeMacOS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB