Show seed in project view

Closes #59
This commit is contained in:
Alexis Sellier
2021-07-23 15:49:55 +02:00
parent 7fc675f728
commit 17f048c87a
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -187,6 +187,11 @@
<div class="stat">
<strong>{tree.stats.contributors}</strong> contributor(s)
</div>
{#if config.seed.api}
<div class="stat" title="Project data is fetched from this seed">
<span>{utils.formatSeedApi(config.seed.api)}</span>
</div>
{/if}
<div class="anchor">
{#if org}
{#await getAnchor}
+8
View File
@@ -58,6 +58,14 @@ export function formatHash(hash: string): string {
+ hash.substring(hash.length - 4, hash.length);
}
export function formatSeedApi(input: string): string {
const match = input.match(/^https?:\/\/([^:]+)/);
if (match) {
return match[1];
}
return input;
}
export function capitalize(s: string): string {
if (s === "") return s;
return s[0].toUpperCase() + s.substr(1);