From 9942ca6f7ad6126ab7faa5a65d09c853c6383469 Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:29:41 +1200 Subject: [PATCH 1/7] Implement the URL rewriting feature --- rosey/Cargo.lock | 1 + rosey/Cargo.toml | 1 + .../features/build/rosey-build-links.feature | 8 + .../rosey-build-translated-links.feature | 119 +++++++++++++++ .../generate/rosey-generate-urls.feature | 31 ++++ rosey/src/lib.rs | 18 +++ rosey/src/main.rs | 9 ++ rosey/src/options.rs | 3 + rosey/src/runners/builder.rs | 9 +- rosey/src/runners/builder/html.rs | 140 +++++++++++++++--- rosey/src/runners/builder/html/utils.rs | 4 + rosey/src/runners/generator.rs | 20 +++ rosey/src/runners/generator/html.rs | 2 + rosey/test.sh | 4 +- 14 files changed, 344 insertions(+), 25 deletions(-) create mode 100644 rosey/features/build/rosey-build-translated-links.feature create mode 100644 rosey/features/generate/rosey-generate-urls.feature diff --git a/rosey/Cargo.lock b/rosey/Cargo.lock index ece80d1..e1e9094 100644 --- a/rosey/Cargo.lock +++ b/rosey/Cargo.lock @@ -2074,6 +2074,7 @@ dependencies = [ "serde_json", "sha2", "tokio", + "url", ] [[package]] diff --git a/rosey/Cargo.toml b/rosey/Cargo.toml index dbc8d8a..79233f4 100644 --- a/rosey/Cargo.toml +++ b/rosey/Cargo.toml @@ -24,3 +24,4 @@ actix-files = "0.6" tokio = { version = "1.36", features = ["macros", "rt-multi-thread", "time"] } notify = "5.0.0" charabia = "0.6.0" +url = "2" diff --git a/rosey/features/build/rosey-build-links.feature b/rosey/features/build/rosey-build-links.feature index 8f45844..a08e6b9 100644 --- a/rosey/features/build/rosey-build-links.feature +++ b/rosey/features/build/rosey-build-links.feature @@ -15,6 +15,8 @@ Feature: Rosey Links