From ad2d56f5852b4edf7305fb53489b6f738b88802e Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 16 Sep 2024 14:12:01 +0200 Subject: [PATCH] move https from code to the webring --- server/src/main.rs | 9 +++------ site/index.nix | 4 ++-- webring.nix | 14 +++++++------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 80af5ef..5c76db3 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -19,10 +19,9 @@ async fn next( if let Some((i, _)) = members.iter().enumerate().find(|(_, member)| member.name == *name) { let next_index = (i + 1) % members.len(); let next_site = &members[next_index].site; - let next_url = format!("https://{next_site}/"); return Response::PermanentRedirect() - .header(header::LOCATION, next_url) + .header(header::LOCATION, next_site) .header(header::CACHE_CONTROL, "no-store") .take(); } @@ -41,10 +40,9 @@ async fn prev( if let Some((i, _)) = members.iter().enumerate().find(|(_, member)| member.name == *name) { let prev_index = if i == 0 { members.len() - 1 } else { i - 1 }; let prev_site = &members[prev_index].site; - let prev_url = format!("https://{prev_site}/"); return Response::PermanentRedirect() - .header(header::LOCATION, prev_url) + .header(header::LOCATION, prev_site) .header(header::CACHE_CONTROL, "no-store") .take(); } @@ -61,10 +59,9 @@ async fn rand( ) -> impl web::Responder { let rand_index = thread_rng().gen_range(0..members.len()); let rand_site = &members[rand_index].site; - let rand_url = format!("https://{rand_site}/"); Response::PermanentRedirect() - .header(header::LOCATION, rand_url) + .header(header::LOCATION, rand_site) .header(header::CACHE_CONTROL, "no-store") .take() } diff --git a/site/index.nix b/site/index.nix index 9bb3850..871f3a1 100644 --- a/site/index.nix +++ b/site/index.nix @@ -41,9 +41,9 @@ in { in /*html*/''
  • - ${member.name} + ${member.name} ${optionalString hasConfig /*html*/'' - their nixos config + their nixos config ''}
  • diff --git a/webring.nix b/webring.nix index 2bd1cca..318edf8 100644 --- a/webring.nix +++ b/webring.nix @@ -1,9 +1,9 @@ [ - { name = "poz"; site = "jacekpoz.pl"; config = "flake.jacekpoz.pl"; } - { name = "krizej"; site = "krizej.codeberg.page"; config = "git.jacekpoz.pl/krizej/nix"; } - { name = "partywumpus"; site = "partywump.us"; config = "nix.partywump.us"; } - { name = "notashelf"; site = "notashelf.dev"; config = "github.com/NotAShelf/nyx"; } - { name = "twig"; site = "imnottwig.github.io"; config = "git.disroot.org/twigthecat/nixos"; } - { name = "fufexan"; site = "fufexan.net"; config = "dots.fufexan.net"; } - { name = "orangc"; site = "orangc.xyz"; config = "github.com/orxngc/dots"; } + { name = "poz"; site = "https://jacekpoz.pl"; config = "https://flake.jacekpoz.pl"; } + { name = "krizej"; site = "https://krizej.codeberg.page"; config = "https://git.jacekpoz.pl/krizej/nix"; } + { name = "partywumpus"; site = "https://partywump.us"; config = "https://nix.partywump.us"; } + { name = "notashelf"; site = "https://notashelf.dev"; config = "https://github.com/NotAShelf/nyx"; } + { name = "twig"; site = "https://imnottwig.github.io"; config = "https://git.disroot.org/twigthecat/nixos"; } + { name = "fufexan"; site = "https://fufexan.net"; config = "https://dots.fufexan.net"; } + { name = "orangc"; site = "https://orangc.xyz"; config = "https://github.com/orxngc/dots"; } ]