render: add pathname to the page context
needed when we need to insert a comment system
This commit is contained in:
parent
62555714e6
commit
800a39956a
|
@ -64,6 +64,8 @@ struct PageContext {
|
||||||
// (e.g. the workers.dev domain, which is differnent
|
// (e.g. the workers.dev domain, which is differnent
|
||||||
// from where you actually deploy the worker)
|
// from where you actually deploy the worker)
|
||||||
base_url: String,
|
base_url: String,
|
||||||
|
// The pathname part of the URL
|
||||||
|
pathname: String,
|
||||||
// The current query string
|
// The current query string
|
||||||
query: String
|
query: String
|
||||||
}
|
}
|
||||||
|
@ -148,6 +150,7 @@ fn build_handlebars() -> Handlebars<'static> {
|
||||||
fn build_page_context(url: &Url) -> PageContext {
|
fn build_page_context(url: &Url) -> PageContext {
|
||||||
PageContext {
|
PageContext {
|
||||||
base_url: url.origin(),
|
base_url: url.origin(),
|
||||||
|
pathname: url.pathname(),
|
||||||
query: url.search()
|
query: url.search()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue