diff --git a/src/render.rs b/src/render.rs index 2c6dc34..2386d40 100644 --- a/src/render.rs +++ b/src/render.rs @@ -64,6 +64,8 @@ struct PageContext { // (e.g. the workers.dev domain, which is differnent // from where you actually deploy the worker) base_url: String, + // The pathname part of the URL + pathname: String, // The current query string query: String } @@ -148,6 +150,7 @@ fn build_handlebars() -> Handlebars<'static> { fn build_page_context(url: &Url) -> PageContext { PageContext { base_url: url.origin(), + pathname: url.pathname(), query: url.search() } }