Skip to content

Commit

Permalink
fix: fixed serving bug with index page
Browse files Browse the repository at this point in the history
I forgot to remove two if statements in a previous commit!
  • Loading branch information
arctic-hen7 committed Nov 6, 2022
1 parent 3a54f40 commit 8a1efb5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/perseus/src/server/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,7 @@ pub async fn get_page_for_template<M: MutableStore, T: TranslationsManager>(
.get_translator_for_locale(locale.to_string())
.await?;

let mut path = raw_path;
// If the path is empty, we're looking for the special `index` page
if path.is_empty() {
path = "index";
}
let path = raw_path;
// Remove `/` from the path by encoding it as a URL (that's what we store) and
// add the locale
let path_encoded = format!("{}-{}", locale, urlencoding::encode(path));
Expand Down Expand Up @@ -679,11 +675,7 @@ pub async fn get_page<M: MutableStore, T: TranslationsManager>(
templates: &TemplateMap<SsrNode>,
render_html: bool,
) -> Result<PageData, ServerError> {
let mut path = props.raw_path;
// If the path is empty, we're looking for the special `index` page
if path.is_empty() {
path = "index";
}
let path = props.raw_path;
// Get the template to use
let template = templates.get(template_name);
let template = match template {
Expand Down

0 comments on commit 8a1efb5

Please sign in to comment.