Add generator and result page
This commit is contained in:
parent
d5e6bf7839
commit
eb0ee4b31d
23
templates/generate.rs.html
Normal file
23
templates/generate.rs.html
Normal file
@ -0,0 +1,23 @@
|
||||
@use super::base;
|
||||
@use crate::VersionInfo;
|
||||
|
||||
@(version_info: VersionInfo, domain: &str, url: &str, service: &str, path: &str)
|
||||
|
||||
@:base("Hits-of-Code Badges", "Badge Generator", {
|
||||
|
||||
<p>
|
||||
Here is the markdown for the badge for <a href="https://@url/@path">@url/@path</a>
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
[![Hits-of-Code](https://@domain/@service/@path)](https://@domain/view/@service/@path)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
It will be rendered like this
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<a href="https://@domain/view/@service/@path"><img src="https://@domain/@service/@path" alt="example badge" /></a>
|
||||
</pre>
|
||||
}, version_info)
|
@ -45,6 +45,21 @@ would render this badge:
|
||||
alt="example badge" /></a>
|
||||
</pre>
|
||||
|
||||
<h2>Badge Generator</h2>
|
||||
|
||||
<form method="post" action="/generate">
|
||||
<select name="service" id="service">
|
||||
<option value="github">GitHub</option>
|
||||
<option value="gitlab">Gitlab</option>
|
||||
<option value="bitbucket">Bitbucket</option>
|
||||
</select>
|
||||
<label>/</label>
|
||||
<input name="user" id="user" type="text" placeholder="user" />
|
||||
<label>/</label>
|
||||
<input name="repo" id="repo" type="text" placeholder="repository" />
|
||||
<button type="submit">Generate</button>
|
||||
</form>
|
||||
|
||||
<h2>Source Code</h2>
|
||||
|
||||
<p>
|
||||
|
Loading…
Reference in New Issue
Block a user