1{{define "content"}}
2{{if .IsEmpty}}
3<section aria-labelledby="empty-state-heading">
4 <h2 id="empty-state-heading">Empty repository</h2>
5 <p>This repository is empty. Initialize it with your first commit:</p>
6 <pre><code>git clone {{.SSHURL}}
7cd {{.Repo.Name}}
8touch README.md
9git add README.md
10git commit -m "Initial commit"
11git push -u origin main</code></pre>
12</section>
13{{else}}
14<fieldset>
15 <h3>Clone</h3>
16 <label>
17 <input name="url-type" type="checkbox" role="switch" />
18 Use HTTP
19 </label>
20 <p id="ssh-url"><code>git clone {{.SSHURL}}</code></p>
21 <p id="http-url" style="display: none;"><code>git clone {{.HTTPURL}}</code></p>
22</fieldset>
23
24<script>
25document.querySelector('input[name="url-type"]').addEventListener('change', function() {
26 const sshUrl = document.getElementById('ssh-url');
27 const httpUrl = document.getElementById('http-url');
28
29 if (this.checked) {
30 sshUrl.style.display = 'none';
31 httpUrl.style.display = 'block';
32 } else {
33 sshUrl.style.display = 'block';
34 httpUrl.style.display = 'none';
35 }
36});
37</script>
38
39{{if .ReadmeHTML}}
40<section aria-labelledby="readme-heading">
41 <h2 id="readme-heading">README</h2>
42 <article>
43 {{.ReadmeHTML}}
44 </article>
45</section>
46{{end}}
47{{end}}
48{{end}}