render: add pathname to the page context
needed when we need to insert a comment systemmaster
parent
62555714e6
commit
800a39956a
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue