From 1f807a14fbe78fcd8b02bb0403b52b48bc4df70a Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 30 Apr 2019 14:20:11 +0200 Subject: [PATCH] Use version info struct --- templates/base.rs.html | 6 ++++-- templates/index.rs.html | 5 +++-- templates/overview.rs.html | 7 ++++--- templates/p404.rs.html | 5 +++-- templates/p500.rs.html | 5 +++-- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/templates/base.rs.html b/templates/base.rs.html index 115b14b..567cc7e 100644 --- a/templates/base.rs.html +++ b/templates/base.rs.html @@ -1,4 +1,6 @@ -@(title: &str, header: &str, content: Content, commit: &str, version: &str) +@use crate::VersionInfo; + +@(title: &str, header: &str, content: Content, version_info: VersionInfo) @@ -32,7 +34,7 @@ diff --git a/templates/index.rs.html b/templates/index.rs.html index da129fe..ec004cc 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -1,6 +1,7 @@ @use super::base; +@use crate::VersionInfo; -@(commit: &str, version: &str, domain: &str) +@(version_info: VersionInfo, domain: &str) @:base("Hits-of-Code Badges", "Hits-of-Code Badges", { @@ -60,4 +61,4 @@ my GPG key (from a keyserver), or by using any other UID from my key.

-}, commit, version) +}, version_info) diff --git a/templates/overview.rs.html b/templates/overview.rs.html index c01ff0a..a9cdd3c 100644 --- a/templates/overview.rs.html +++ b/templates/overview.rs.html @@ -1,11 +1,12 @@ @use super::base; +@use crate::VersionInfo; -@(commit: &str, version: &str, domain: &str, path: &str, url: &str, hoc: u64, head: &str, commit_url: &str) +@(version_info: VersionInfo, domain: &str, path: &str, url: &str, hoc: u64, hoc_pretty: &str, head: &str, commit_url: &str) @:base("Hits-of-Code Badges", "Overview", {

-The project at @url has @hoc hits of code at @head. +The project @url has @hoc_pretty (exactly @hoc) hits of code at @head.

@@ -15,4 +16,4 @@ To include the badge in your readme, use the following markdown:

 [![Hits-of-Code](https://@domain/@path)](https://@domain/view/@path)
 
-}, commit, version) +}, version_info) diff --git a/templates/p404.rs.html b/templates/p404.rs.html index 1ae929a..8189f6f 100644 --- a/templates/p404.rs.html +++ b/templates/p404.rs.html @@ -1,6 +1,7 @@ @use super::base; +@use crate::VersionInfo; -@(commit: &str, version: &str) +@(version_info: VersionInfo) @:base("Page not Found - Hits-of-Code Badges", "404 - Page not Found", {

@@ -10,4 +11,4 @@

If you think, this is a mistake on my side, please drop me a mail.

-}, commit, version) +}, version_info) diff --git a/templates/p500.rs.html b/templates/p500.rs.html index 0bdebeb..4798fca 100644 --- a/templates/p500.rs.html +++ b/templates/p500.rs.html @@ -1,6 +1,7 @@ @use super::base; +@use crate::VersionInfo; -@(commit: &str, version: &str) +@(version_info: VersionInfo) @:base("Internal Server Error - Hits-of-Code Badges", "500 - Internal Server Error", {

@@ -10,4 +11,4 @@

If you think, this is a bug, please drop me a mail.

-}, commit, version) +}, version_info)