Put the lang in front of url (WIP)
This commit is contained in:
parent
418d31a127
commit
b39cb1c067
4 changed files with 8 additions and 6 deletions
|
|
@ -335,7 +335,7 @@ fn url_rewriting(mut req: Request) -> Request {
|
|||
if let Some(lang) = parts.next() {
|
||||
let available_codes = translation::available_codes();
|
||||
if available_codes.contains(&lang) {
|
||||
let mut rest: String = String::from("");
|
||||
let mut rest = String::from("");
|
||||
for part in parts {
|
||||
rest.push('/');
|
||||
rest.push_str(part);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{% macro recipe_item(id, title, is_current) %}
|
||||
<li>
|
||||
<a href="/recipe/view/{{ id }}" class="recipe-item
|
||||
<a href="/{{ tr.current_lang_code() }}/recipe/view/{{ id }}" class="recipe-item
|
||||
{%~ if is_current %}
|
||||
current
|
||||
{% endif %}" id="recipe-{{ id }}"
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<a class="title" href="/"><img class="logo" src="/static/logo.svg" alt="logo">{{ tr.t(Sentence::MainTitle) }}</a>
|
||||
<a class="title" href="/{{ tr.current_lang_code() }}/"><img class="logo" src="/static/logo.svg" alt="logo">{{ tr.t(Sentence::MainTitle) }}</a>
|
||||
Loading…
Add table
Add a link
Reference in a new issue