From 4ddaa84e5f2c181d6ec7ac7e0d826fa9fcc3f242 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Mon, 30 Jan 2023 09:22:45 +0100 Subject: [PATCH] Use new aliases for template functions `page.rs.html` used to result in a function `templates::page`. Since ructe 0.7.2, `templates::page_html` was used and now the old alias has been removed. --- src/error.rs | 4 ++-- src/lib.rs | 8 ++++---- templates/generate.rs.html | 4 ++-- templates/index.rs.html | 4 ++-- templates/overview.rs.html | 4 ++-- templates/p404.rs.html | 4 ++-- templates/p404_no_master.rs.html | 4 ++-- templates/p500.rs.html | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/error.rs b/src/error.rs index faa13d8..0f71446 100644 --- a/src/error.rs +++ b/src/error.rs @@ -43,11 +43,11 @@ impl ResponseError for Error { let mut buf = Vec::new(); match self { Error::BranchNotFound => { - templates::p404_no_master(&mut buf, VERSION_INFO, 0).unwrap(); + templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap(); HttpResponse::NotFound().content_type("text/html").body(buf) } _ => { - templates::p500(&mut buf, VERSION_INFO, 0).unwrap(); + templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap(); HttpResponse::InternalServerError() .content_type("text/html") .body(buf) diff --git a/src/lib.rs b/src/lib.rs index f917c51..d24abf8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -408,7 +408,7 @@ async fn overview( url: &url, branch, }; - templates::overview( + templates::overview_html( &mut buf, VERSION_INFO, rc_clone.load(Ordering::Relaxed), @@ -433,7 +433,7 @@ async fn index( repo_count: web::Data, ) -> Result { let mut buf = Vec::new(); - templates::index( + templates::index_html( &mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed), @@ -459,7 +459,7 @@ async fn generate( .filter(|s| !s.is_empty()) .unwrap_or("master"), }; - templates::generate( + templates::generate_html( &mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed), @@ -472,7 +472,7 @@ async fn generate( fn p404(repo_count: web::Data) -> Result { let mut buf = Vec::new(); - templates::p404(&mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed))?; + templates::p404_html(&mut buf, VERSION_INFO, repo_count.load(Ordering::Relaxed))?; Ok(HttpResponse::NotFound().content_type("text/html").body(buf)) } diff --git a/templates/generate.rs.html b/templates/generate.rs.html index 2ce62cc..15c9b85 100644 --- a/templates/generate.rs.html +++ b/templates/generate.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::{statics::VersionInfo, template::RepoGeneratorInfo}; @(version_info: VersionInfo, repo_count: usize, base_url: &str, repo_info: &RepoGeneratorInfo) -@:base("Hits-of-Code Badges", "Badge Generator", { +@:base_html("Hits-of-Code Badges", "Badge Generator", {

Here is the markdown for the badge for @repo_info.user/@repo_info.repo diff --git a/templates/index.rs.html b/templates/index.rs.html index 75934d4..d032390 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize, base_url: &str) -@:base("Hits-of-Code Badges", "Hits-of-Code Badges", { +@:base_html("Hits-of-Code Badges", "Hits-of-Code Badges", {

This API offers badges for the Hits-of-Code metric for your repositories. This metric was proposed by diff --git a/templates/overview.rs.html b/templates/overview.rs.html index ef209a1..578da5d 100644 --- a/templates/overview.rs.html +++ b/templates/overview.rs.html @@ -1,10 +1,10 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @use crate::template::RepoInfo; @(version_info: VersionInfo, repo_count: usize, repo_info: RepoInfo, label: String) -@:base("Hits-of-Code Badges", "Overview", { +@:base_html("Hits-of-Code Badges", "Overview", {

The project @repo_info.url has diff --git a/templates/p404.rs.html b/templates/p404.rs.html index a073b33..c1dfa15 100644 --- a/templates/p404.rs.html +++ b/templates/p404.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize) -@:base("Page not Found - Hits-of-Code Badges", "404 - Page not Found", { +@:base_html("Page not Found - Hits-of-Code Badges", "404 - Page not Found", {

Sorry. I couldn't find the page you are looking for. Please go back to the homepage.

diff --git a/templates/p404_no_master.rs.html b/templates/p404_no_master.rs.html index 309f5c5..6b32df8 100644 --- a/templates/p404_no_master.rs.html +++ b/templates/p404_no_master.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize) -@:base("Branch not Found - Hits-of-Code Badges", "404 - Branch not Found", { +@:base_html("Branch not Found - Hits-of-Code Badges", "404 - Branch not Found", {

Sorry. I couldn't find the requested branch of your repositroy. Currently this service assumes the extistence of a branch named master. If you'd like to request a badge for another branch, you can do so by diff --git a/templates/p500.rs.html b/templates/p500.rs.html index e1725a7..264c08e 100644 --- a/templates/p500.rs.html +++ b/templates/p500.rs.html @@ -1,9 +1,9 @@ -@use super::base; +@use super::base_html; @use crate::statics::VersionInfo; @(version_info: VersionInfo, repo_count: usize) -@:base("Internal Server Error - Hits-of-Code Badges", "500 - Internal Server Error", { +@:base_html("Internal Server Error - Hits-of-Code Badges", "500 - Internal Server Error", {

Oops. Looks like a made a mistake. Please go back to the homepage and try again.