Skip to content

Commit

Permalink
sync rama and minor style improements (light scheme)
Browse files Browse the repository at this point in the history
also add a x-hire-us header for the ones
requiring reverse-engineering
  • Loading branch information
GlenDC committed Aug 14, 2024
1 parent d031e71 commit e36e165
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 16 additions & 9 deletions src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use rama::{
headers::{Accept, HeaderMapExt},
layer::{
compression::CompressionLayer, required_header::AddRequiredResponseHeadersLayer,
trace::TraceLayer,
set_header::SetResponseHeaderLayer, trace::TraceLayer,
},
response::Redirect,
service::web::WebService,
IntoResponse, Request, Response, StatusCode,
HeaderName, HeaderValue, IntoResponse, Request, Response, StatusCode,
},
service::{Service, ServiceBuilder},
service::{Layer, Service},
};
use std::convert::Infallible;

Expand All @@ -38,12 +38,19 @@ pub async fn web_service(
cfg: Config,
) -> impl Service<State, Request, Response = Response, Error = Infallible> {
tracing::info!("creating web service with static dir: {}", cfg.static_dir);
ServiceBuilder::new()
.layer(CacheControlLayer::default())
.layer(AddRequiredResponseHeadersLayer::new())
.layer(CompressionLayer::new())
.layer(TraceLayer::new_for_http())
.service(
(
CacheControlLayer::default(),
AddRequiredResponseHeadersLayer::new(),
SetResponseHeaderLayer::if_not_present(
HeaderName::from_static("x-hire-us"),
HeaderValue::from_static(
"rust development, training, data extraction and reverse engineering",
),
),
CompressionLayer::new(),
TraceLayer::new_for_http(),
)
.layer(
page_web_service!(PageIndex, PageRust, PageData, PageFoss, PageAbout, Sitemap)
.not_found(|req: Request| async move {
if req
Expand Down
10 changes: 5 additions & 5 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
/* Light Mode */
:root {
--bg: rgb(255, 255, 255);
--accent: rgb(125, 125, 125);
--accent: rgb(216, 216, 216);
--fg: rgb(0, 0, 0);
}

.rust {
background-color: #fff6f6;
background-color: #ffe9e9;
}

.data {
background-color: #edf8ed;
background-color: #caf4ca;
}

.about {
background-color: rgb(173, 216, 230);
background-color: rgb(214, 241, 249);
}

/* Dark Mode */
Expand Down Expand Up @@ -188,7 +188,7 @@ body > header a .hover-icon {
@media not all and (hover: none) {
body > header a:hover,
body > footer a:hover {
color: var(--accent);
opacity: 0.65;
}

body > header a:hover .icon {
Expand Down

0 comments on commit e36e165

Please sign in to comment.