Merge branch 'master' into feature/ructe-static

This commit is contained in:
Valentin Brandl
2022-08-22 12:28:56 +02:00
5 changed files with 31 additions and 12 deletions

View File

@ -1,16 +1,16 @@
@use super::base;
@use crate::statics::VersionInfo;
@use crate::{statics::VersionInfo, template::RepoGeneratorInfo};
@(version_info: VersionInfo, repo_count: usize, base_url: &str, url: &str, service: &str, path: &str)
@(version_info: VersionInfo, repo_count: usize, base_url: &str, repo_info: &RepoGeneratorInfo)
@:base("Hits-of-Code Badges", "Badge Generator", {
<p>
Here is the markdown for the badge for <a href="https://@url/@path">@url/@path</a>
Here is the markdown for the badge for <a href="https://@repo_info.service.url()/@repo_info.user/@repo_info.repo">@repo_info.user/@repo_info.repo</a>
</p>
<pre>
[![Hits-of-Code](@base_url/@service/@path)](@base_url/@service/@path/view)
[![Hits-of-Code](@base_url/@repo_info.service.service()/@repo_info.user/@repo_info.repo?branch=@repo_info.branch)](@base_url/@repo_info.service.service()/@repo_info.user/@repo_info.repo/view?branch=@repo_info.branch)
</pre>
<p>
@ -18,6 +18,6 @@ It will be rendered like this
</p>
<pre>
<a href="@base_url/@service/@path/view"><img src="@base_url/@service/@path" alt="example badge" /></a>
<a href="@base_url/@repo_info.service.service()/@repo_info.user/@repo_info.repo/view?branch=@repo_info.branch"><img src="@base_url/@repo_info.service.service()/@repo_info.user/@repo_info.repo?branch=@repo_info.branch" alt="example badge" /></a>
</pre>
}, version_info, repo_count)

View File

@ -80,6 +80,8 @@ the lines of
<input name="user" id="user" type="text" placeholder="user" />
<label>/</label>
<input name="repo" id="repo" type="text" placeholder="repository" />
<label>:</label>
<input name="branch" id="branch" type="text" placeholder="branch (defaults to `master`)" />
<button type="submit">Generate</button>
</form>