Compare commits

...

47 Commits

Author SHA1 Message Date
391bb6faeb Use ructe static file support to serve static files with hashes and caching 2022-08-21 13:48:03 +02:00
c93c83f004 Merge pull request #473 from vbrandl/dependabot/cargo/serde-1.0.143
chore(deps): Bump serde from 1.0.142 to 1.0.143
2022-08-18 14:08:25 +02:00
e82037c23b chore(deps): Bump serde from 1.0.142 to 1.0.143
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.142 to 1.0.143.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.142...v1.0.143)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-09 04:13:44 +00:00
ecbc63f522 Merge pull request #468 from vbrandl/dependabot/cargo/tracing-0.1.36
chore(deps): Bump tracing from 0.1.35 to 0.1.36
2022-08-04 12:49:57 +02:00
315eb514f4 chore(deps): Bump tracing from 0.1.35 to 0.1.36
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.35 to 0.1.36.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.35...tracing-0.1.36)

---
updated-dependencies:
- dependency-name: tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 10:40:55 +00:00
9139c8f005 Merge pull request #470 from vbrandl/dependabot/cargo/config-0.13.2
chore(deps): Bump config from 0.13.1 to 0.13.2
2022-08-04 12:39:48 +02:00
96ded8a0a8 Merge pull request #471 from vbrandl/dependabot/cargo/serde-1.0.142
chore(deps): Bump serde from 1.0.140 to 1.0.142
2022-08-04 12:39:25 +02:00
15692cbb08 Merge pull request #472 from vbrandl/dependabot/cargo/serde_json-1.0.83
chore(deps): Bump serde_json from 1.0.82 to 1.0.83
2022-08-04 12:38:59 +02:00
98d80faf3a chore(deps): Bump serde_json from 1.0.82 to 1.0.83
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.82 to 1.0.83.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.82...v1.0.83)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 04:14:04 +00:00
a0cb623dc6 chore(deps): Bump serde from 1.0.140 to 1.0.142
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.140 to 1.0.142.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.140...v1.0.142)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-04 04:13:56 +00:00
28582e58e0 chore(deps): Bump config from 0.13.1 to 0.13.2
Bumps [config](https://github.com/mehcode/config-rs) from 0.13.1 to 0.13.2.
- [Release notes](https://github.com/mehcode/config-rs/releases)
- [Changelog](https://github.com/mehcode/config-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mehcode/config-rs/compare/0.13.1...0.13.2)

---
updated-dependencies:
- dependency-name: config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-03 04:12:43 +00:00
e79e1e2634 Merge pull request #467 from vbrandl/dependabot/cargo/bytes-1.2.1
chore(deps): Bump bytes from 1.1.0 to 1.2.1
2022-07-30 17:16:13 +02:00
097a1affcf Merge pull request #462 from vbrandl/dependabot/cargo/tracing-subscriber-0.3.15
chore(deps): Bump tracing-subscriber from 0.3.14 to 0.3.15
2022-07-30 17:07:41 +02:00
df022f538c chore(deps): Bump bytes from 1.1.0 to 1.2.1
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.1.0 to 1.2.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/commits)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-30 15:07:38 +00:00
b4327ff28f Merge pull request #463 from vbrandl/dependabot/cargo/serde-1.0.140
chore(deps): Bump serde from 1.0.139 to 1.0.140
2022-07-30 17:07:31 +02:00
38a837bc70 Merge pull request #464 from vbrandl/dependabot/cargo/vergen-7.3.1
chore(deps): Bump vergen from 7.2.1 to 7.3.1
2022-07-30 17:07:17 +02:00
743fe98d1b Merge pull request #465 from vbrandl/dependabot/cargo/tokio-1.20.1
chore(deps): Bump tokio from 1.20.0 to 1.20.1
2022-07-30 17:07:02 +02:00
d0e2f21339 Merge pull request #466 from vbrandl/dependabot/cargo/git2-0.15.0
chore(deps): Bump git2 from 0.14.4 to 0.15.0
2022-07-30 17:06:31 +02:00
ebe844d305 chore(deps): Bump git2 from 0.14.4 to 0.15.0
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.14.4 to 0.15.0.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.14.4...git2-curl-0.15.0)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-29 04:16:42 +00:00
c0119ccc97 chore(deps): Bump tokio from 1.20.0 to 1.20.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.20.0 to 1.20.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.20.0...tokio-1.20.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-26 04:17:03 +00:00
6ae96e9b33 chore(deps): Bump vergen from 7.2.1 to 7.3.1
Bumps [vergen](https://github.com/rustyhorde/vergen) from 7.2.1 to 7.3.1.
- [Release notes](https://github.com/rustyhorde/vergen/releases)
- [Commits](https://github.com/rustyhorde/vergen/compare/7.2.1...7.3.1)

---
updated-dependencies:
- dependency-name: vergen
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-22 04:20:57 +00:00
85bd714eb8 chore(deps): Bump serde from 1.0.139 to 1.0.140
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.139 to 1.0.140.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.139...v1.0.140)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 04:21:57 +00:00
4d63a3cb0b chore(deps): Bump tracing-subscriber from 0.3.14 to 0.3.15
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.14 to 0.3.15.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.14...tracing-subscriber-0.3.15)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 04:21:43 +00:00
5d7d06abef Merge pull request #460 from vbrandl/dependabot/cargo/tokio-1.20.0
chore(deps): Bump tokio from 1.19.2 to 1.20.0
2022-07-15 13:16:54 +02:00
a84885a2ca Merge pull request #459 from vbrandl/dependabot/cargo/serde-1.0.139
chore(deps): Bump serde from 1.0.138 to 1.0.139
2022-07-15 13:16:06 +02:00
ee1de29158 chore(deps): Bump tokio from 1.19.2 to 1.20.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.19.2 to 1.20.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.19.2...tokio-1.20.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-14 04:15:59 +00:00
e48279c6d8 chore(deps): Bump serde from 1.0.138 to 1.0.139
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.138 to 1.0.139.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.138...v1.0.139)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-12 04:18:20 +00:00
3df296e542 Merge pull request #454 from vbrandl/dependabot/cargo/tracing-actix-web-0.6.0
chore(deps): Bump tracing-actix-web from 0.5.1 to 0.6.0
2022-07-06 20:24:35 +02:00
a65f8d9d72 Merge pull request #455 from vbrandl/dependabot/cargo/serde_json-1.0.82
chore(deps): Bump serde_json from 1.0.81 to 1.0.82
2022-07-06 19:58:10 +02:00
ec04b0a76f Merge pull request #457 from vbrandl/dependabot/cargo/serde-1.0.138
chore(deps): Bump serde from 1.0.137 to 1.0.138
2022-07-06 19:57:57 +02:00
5387265a3e chore(deps): Bump tracing-actix-web from 0.5.1 to 0.6.0
Bumps [tracing-actix-web](https://github.com/LukeMathWalker/tracing-actix-web) from 0.5.1 to 0.6.0.
- [Release notes](https://github.com/LukeMathWalker/tracing-actix-web/releases)
- [Commits](https://github.com/LukeMathWalker/tracing-actix-web/compare/v0.5.1...v0.6.0)

---
updated-dependencies:
- dependency-name: tracing-actix-web
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-06 17:57:42 +00:00
0379d4bfc0 Merge pull request #458 from vbrandl/dependabot/cargo/tracing-subscriber-0.3.14
chore(deps): Bump tracing-subscriber from 0.3.11 to 0.3.14
2022-07-06 19:56:34 +02:00
7e1b86ace1 chore(deps): Bump tracing-subscriber from 0.3.11 to 0.3.14
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.11 to 0.3.14.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.11...tracing-subscriber-0.3.14)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 04:17:13 +00:00
f000dbd27c chore(deps): Bump serde from 1.0.137 to 1.0.138
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.137 to 1.0.138.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.137...v1.0.138)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 04:17:06 +00:00
3fd245da4a chore(deps): Bump serde_json from 1.0.81 to 1.0.82
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.81...v1.0.82)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 04:20:49 +00:00
6f292796a4 Merge pull request #453 from vbrandl/dependabot/cargo/tracing-bunyan-formatter-0.3.3
chore(deps): Bump tracing-bunyan-formatter from 0.3.2 to 0.3.3
2022-06-27 10:59:08 +02:00
95bc3491ec chore(deps): Bump tracing-bunyan-formatter from 0.3.2 to 0.3.3
Bumps [tracing-bunyan-formatter](https://github.com/LukeMathWalker/tracing-bunyan-formatter) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/LukeMathWalker/tracing-bunyan-formatter/releases)
- [Commits](https://github.com/LukeMathWalker/tracing-bunyan-formatter/compare/v0.3.2...v0.3.3)

---
updated-dependencies:
- dependency-name: tracing-bunyan-formatter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-27 04:12:20 +00:00
9b961032aa chore: Update dependencies
Some checks failed
continuous-integration/drone/push Build is failing
2022-06-16 13:34:20 +02:00
32a2cc7132 chore: Bump version number (v0.22.4)
Some checks failed
continuous-integration/drone/tag Build is failing
continuous-integration/drone/push Build is failing
2022-06-16 12:32:54 +02:00
aeb1293067 Merge pull request #452 from vbrandl/dependabot/cargo/reqwest-0.11.11
Some checks failed
continuous-integration/drone/push Build is failing
chore(deps): Bump reqwest from 0.11.10 to 0.11.11
2022-06-16 12:10:52 +02:00
fd70162033 chore(deps): Bump reqwest from 0.11.10 to 0.11.11
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.10 to 0.11.11.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.10...v0.11.11)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-14 04:22:08 +00:00
fa93e0e8b7 Merge pull request #449 from vbrandl/dependabot/cargo/tokio-1.19.2
Bump tokio from 1.18.2 to 1.19.2
2022-06-13 11:13:49 +02:00
33b215f1e5 Merge pull request #450 from vbrandl/dependabot/cargo/vergen-7.2.1
Bump vergen from 7.2.0 to 7.2.1
2022-06-13 11:13:39 +02:00
4029216a18 Merge pull request #451 from vbrandl/dependabot/cargo/actix-web-4.1.0
Bump actix-web from 4.0.1 to 4.1.0
2022-06-13 11:13:29 +02:00
c67fcd84ca Bump actix-web from 4.0.1 to 4.1.0
Bumps [actix-web](https://github.com/actix/actix-web) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/actix/actix-web/releases)
- [Changelog](https://github.com/actix/actix-web/blob/master/CHANGES.md)
- [Commits](https://github.com/actix/actix-web/compare/web-v4.0.1...web-v4.1.0)

---
updated-dependencies:
- dependency-name: actix-web
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 04:16:57 +00:00
f6492890ae Bump vergen from 7.2.0 to 7.2.1
Bumps [vergen](https://github.com/rustyhorde/vergen) from 7.2.0 to 7.2.1.
- [Release notes](https://github.com/rustyhorde/vergen/releases)
- [Commits](https://github.com/rustyhorde/vergen/compare/7.2.0...7.2.1)

---
updated-dependencies:
- dependency-name: vergen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-08 04:13:26 +00:00
901b492641 Bump tokio from 1.18.2 to 1.19.2
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.18.2 to 1.19.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-07 04:14:50 +00:00
6 changed files with 289 additions and 294 deletions

509
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package] [package]
name = "hoc" name = "hoc"
version = "0.22.3" version = "0.22.4"
authors = ["Valentin Brandl <vbrandl@riseup.net>"] authors = ["Valentin Brandl <vbrandl@riseup.net>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
@ -14,33 +14,34 @@ name = "hoc"
[dependencies] [dependencies]
actix-rt = "2.7.0" actix-rt = "2.7.0"
actix-web = "4.0.1" actix-web = "4.1.0"
badge = "0.3.0" badge = "0.3.0"
bytes = "1.1.0" bytes = "1.2.1"
config = { version = "0.13.1", features = ["toml"] } config = { version = "0.13.2", features = ["toml"] }
dotenv = "0.15.0" dotenv = "0.15.0"
futures = "0.3.21" futures = "0.3.21"
git2 = "0.14.4" git2 = "0.15.0"
lazy_static = "1.4.0" lazy_static = "1.4.0"
mime = "0.3"
number_prefix = "0.4.0" number_prefix = "0.4.0"
openssl-probe = "0.1.5" openssl-probe = "0.1.5"
reqwest = "0.11.10" reqwest = "0.11.11"
serde = "1.0.137" serde = "1.0.143"
serde_derive = "1.0.136" serde_derive = "1.0.137"
serde_json = "1.0.81" serde_json = "1.0.83"
tracing = "0.1.34" tracing = "0.1.36"
tracing-actix-web = "0.5.1" tracing-actix-web = "0.6.0"
tracing-bunyan-formatter = "0.3.2" tracing-bunyan-formatter = "0.3.3"
tracing-futures = "0.2.5" tracing-futures = "0.2.5"
tracing-log = "0.1.3" tracing-log = "0.1.3"
tracing-subscriber = { version = "0.3.11", features = ["registry", "env-filter"] } tracing-subscriber = { version = "0.3.15", features = ["registry", "env-filter"] }
[build-dependencies] [build-dependencies]
ructe = "0.14.0" ructe = { version = "0.14.0", features = ["mime03"] }
vergen = { version = "7.2.0", default-features = false, features = ["git"] } vergen = { version = "7.3.1", default-features = false, features = ["git"] }
[dev-dependencies] [dev-dependencies]
awc = "3.0.0" awc = "3.0.0"
ructe = "0.14.0" ructe = "0.14.0"
tempfile = "3.3.0" tempfile = "3.3.0"
tokio = "1.18.2" tokio = "1.20.1"

View File

@ -8,5 +8,8 @@ fn main() -> Result<(), RucteError> {
let mut config = Config::default(); let mut config = Config::default();
*config.git_mut().sha_kind_mut() = ShaKind::Short; *config.git_mut().sha_kind_mut() = ShaKind::Short;
vergen(config).expect("Unable to generate static repo info"); vergen(config).expect("Unable to generate static repo info");
Ructe::from_env()?.compile_templates("templates") let mut ructe = Ructe::from_env()?;
let mut statics = ructe.statics()?;
statics.add_files("static")?;
ructe.compile_templates("templates")
} }

View File

@ -23,7 +23,7 @@ use crate::{
config::Settings, config::Settings,
error::{Error, Result}, error::{Error, Result},
service::{Bitbucket, FormService, GitHub, Gitlab, Service, Sourcehut}, service::{Bitbucket, FormService, GitHub, Gitlab, Service, Sourcehut},
statics::{CLIENT, CSS, FAVICON, VERSION_INFO}, statics::{CLIENT, VERSION_INFO},
template::RepoInfo, template::RepoInfo,
}; };
use actix_web::{ use actix_web::{
@ -46,6 +46,7 @@ use std::{
sync::atomic::Ordering, sync::atomic::Ordering,
time::{Duration, SystemTime}, time::{Duration, SystemTime},
}; };
use templates::statics::{self as template_statics, StaticFile};
use tracing::Instrument; use tracing::Instrument;
include!(concat!(env!("OUT_DIR"), "/templates.rs")); include!(concat!(env!("OUT_DIR"), "/templates.rs"));
@ -462,14 +463,32 @@ async fn async_p404(repo_count: web::Data<AtomicUsize>) -> Result<HttpResponse>
p404(repo_count) p404(repo_count)
} }
#[get("/tacit-css.min.css")] /// A duration to add to current time for a far expires header.
async fn css() -> HttpResponse { static FAR: Duration = Duration::from_secs(180 * 24 * 60 * 60);
HttpResponse::Ok().content_type("text/css").body(CSS)
#[get("/static/{filename}")]
async fn static_file(
path: web::Path<String>,
repo_count: web::Data<AtomicUsize>,
) -> Result<HttpResponse> {
StaticFile::get(&path)
.map(|data| {
let far_expires = SystemTime::now() + FAR;
HttpResponse::Ok()
.insert_header(Expires(far_expires.into()))
.content_type(data.mime.clone())
.body(data.content)
})
.map(Result::Ok)
.unwrap_or_else(|| p404(repo_count))
} }
#[get("/favicon.ico")] #[get("/favicon.ico")]
async fn favicon32() -> HttpResponse { async fn favicon32() -> HttpResponse {
HttpResponse::Ok().content_type("image/png").body(FAVICON) let data = &template_statics::favicon32_png;
HttpResponse::Ok()
.content_type(data.mime.clone())
.body(data.content)
} }
async fn start_server(listener: TcpListener, settings: Settings) -> std::io::Result<Server> { async fn start_server(listener: TcpListener, settings: Settings) -> std::io::Result<Server> {
@ -486,7 +505,7 @@ async fn start_server(listener: TcpListener, settings: Settings) -> std::io::Res
.wrap(middleware::NormalizePath::new(TrailingSlash::Trim)) .wrap(middleware::NormalizePath::new(TrailingSlash::Trim))
.service(index) .service(index)
.service(health_check) .service(health_check)
.service(css) .service(static_file)
.service(favicon32) .service(favicon32)
.service(generate) .service(generate)
.default_service(web::to(async_p404)); .default_service(web::to(async_p404));

View File

@ -7,8 +7,6 @@ pub(crate) const VERSION_INFO: VersionInfo = VersionInfo {
commit: env!("VERGEN_GIT_SHA_SHORT"), commit: env!("VERGEN_GIT_SHA_SHORT"),
version: env!("CARGO_PKG_VERSION"), version: env!("CARGO_PKG_VERSION"),
}; };
pub(crate) const CSS: &str = include_str!("../static/tacit-css.min.css");
pub(crate) const FAVICON: &[u8] = include_bytes!("../static/favicon32.png");
lazy_static! { lazy_static! {
pub(crate) static ref CLIENT: reqwest::Client = reqwest::Client::new(); pub(crate) static ref CLIENT: reqwest::Client = reqwest::Client::new();

View File

@ -1,3 +1,4 @@
@use super::statics::*;
@use crate::statics::VersionInfo; @use crate::statics::VersionInfo;
@(title: &str, header: &str, content: Content, version_info: VersionInfo, repo_count: usize) @(title: &str, header: &str, content: Content, version_info: VersionInfo, repo_count: usize)
@ -9,7 +10,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="keywords" content="Hits-of-Code, GitHub, Badge" /> <meta name="keywords" content="Hits-of-Code, GitHub, Badge" />
<meta name="description" content="Hits-of-Code Badges for Git repositories" /> <meta name="description" content="Hits-of-Code Badges for Git repositories" />
<link rel="stylesheet" href="/tacit-css.min.css" /> <link rel="stylesheet" href="/static/@tacit_css_min_css.name" />
<title>@title</title> <title>@title</title>
</head> </head>
<body> <body>