diff --git a/docs/_config.yml b/docs/_config.yml index 622fa96..3a22922 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -120,6 +120,11 @@ issues_template: | oss_template: |
You contributed to the following repositories, with {{ format downloads }} combined daily downloads:
+Repository | diff --git a/docs/assets/js/oss.js b/docs/assets/js/oss.js index a24aee2..e0e8ac1 100644 --- a/docs/assets/js/oss.js +++ b/docs/assets/js/oss.js @@ -1,3 +1,6 @@ +--- +layout: null +--- Handlebars.registerHelper('format', function(number) { return new Intl.NumberFormat().format(number); }); @@ -75,7 +78,7 @@ async function lookupAccount() { }, 0); }, 0); - document.getElementById('data').innerHTML = template({ repositories: repositories, downloads: totalDownloads }); + document.getElementById('data').innerHTML = template({ account: account, icon: "{{ '/assets/img/copy.svg' | relative_url }}", repositories: repositories, downloads: totalDownloads }); document.getElementById('unsupported').style.display = 'none'; document.getElementById('supported').style.display = ''; @@ -101,4 +104,17 @@ function setError(message) { function setBusy(busy) { document.getElementById('spinner').style.display = busy ? '' : 'none'; +} + +function copyMarkdown() { + const url = new URL(window.location); + const account = url.searchParams.get('a'); + if (account) + { + const markdown = ` +![Popular packages](https://img.shields.io/endpoint?label=popular%20packages&style=social&logo=nuget&url=https%3A%2F%2Fsponsorlink.devlooped.com%2Fnuget%2Fall?${account}) +![Daily downloads](https://img.shields.io/endpoint?label=Daily%20downloads&style=social&logo=nuget&url=https%3A%2F%2Fsponsorlink.devlooped.com%2Fnuget%2Fdl?${account}) +`; + navigator.clipboard.writeText(markdown); + } } \ No newline at end of file diff --git a/src/Web/Stats.cs b/src/Web/Stats.cs index fec34bb..a82099d 100644 --- a/src/Web/Stats.cs +++ b/src/Web/Stats.cs @@ -14,11 +14,26 @@ public async Task
---|