Commit 845f01f
committed
website: auto-route root by browser language; harden landing flag
Make the site behave like a real bilingual site at the entry point. A
non-Chinese browser (or anyone whose remembered choice is English) hitting
the root now lands on the English page instead of a wall of Chinese; an
explicit 'zh' choice is honored and never bounced. The redirect runs as the
first thing in <head>, before the non-async vue script, so it is not blocked
on a download. Landing switchers write the choice to localStorage so the
auto-route respects it.
Also inline the landing flag's size so it can never depend on a cached
stylesheet rule (the cause of the giant-flag render after the button->anchor
change shipped while old CSS was still cached).1 parent dab1a01 commit 845f01f
2 files changed
Lines changed: 27 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | | - | |
| 6 | + | |
5 | 7 | | |
6 | | - | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
8 | 26 | | |
9 | 27 | | |
10 | 28 | | |
| |||
23 | 41 | | |
24 | 42 | | |
25 | 43 | | |
26 | | - | |
| 44 | + | |
27 | 45 | | |
28 | 46 | | |
29 | 47 | | |
| |||
0 commit comments