Skip to content

Commit

Permalink
fix: timeago
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Aug 4, 2021
1 parent e494151 commit f3a6d71
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions static/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<meta name="description" content="StarCharts">
<meta name="author" content="https://github/caarlos0">
<link rel="stylesheet" href="/static/styles.css?v={{ .Version }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/styles/base16/dracula.min.css"
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.1.0/styles/base16/dracula.min.css"
integrity="sha512-oDvVpANXrKQ6R5B25VO6DooEQWA7jUXleyD6oUWHChC0fjv8wAANSX7lKXtp5D6HbZ7EUxd0wjMibtpCQ+aCDw=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
Expand All @@ -28,7 +29,7 @@
{{ with .Details }}
<div class="main">
<p>
{{ if .StargazersCount }}
{{ if gt .StargazersCount 0 }}
<b>Awesome!</b>
{{ else }}
<b>Hang in there!</b>
Expand All @@ -38,7 +39,7 @@
and now has <b>{{ .StargazersCount }}</b> stars.
</p>
</div>
{{ if .StargazersCount }}
{{ if gt .StargazersCount 0 }}
<div class="chart">
<p>
<img src="/{{ .FullName }}.svg"
Expand All @@ -50,7 +51,7 @@
You can include the chart on your repository's
<code>README.md</code>
as follows:
<pre>
<pre>
<code class="markdown" id="code">
## Stargazers over time

Expand All @@ -70,11 +71,13 @@
{{ end }}
{{ else }}
<div class="main">
{{ with .Error }}<p class="error">{{ . }}</p>{{ end }}
{{ with .Error }}
<p class="error">{{ . }}</p>
{{ end }}
<form method="POST">
<label for="repo">Repository:</label><br>
<input type="text" id="repository" name="repository" value="caarlos0/starcharts" placeholder="caarlos0/starcharts"
autofocus="true"><br>
<input type="text" id="repository" name="repository" value="caarlos0/starcharts"
placeholder="caarlos0/starcharts" autofocus="true"><br>
<input type="submit" value="Submit" class="btn">
</form>
</div>
Expand All @@ -95,7 +98,7 @@
<script>
new ClipboardJS('.copy-btn');
hljs.initHighlightingOnLoad();
timeago().render(document.querySelectorAll('time'));
timeago.render(document.querySelectorAll('time'));
</script>
</body>

Expand Down

0 comments on commit f3a6d71

Please sign in to comment.