Skip to content

Commit ee052b3

Browse files
committed
website: drop the duplicate landing language switch
The landing showed two language switches: the hero #lang-switch button and the header nav language dropdown (used on every other page). Remove the redundant hero button and its now-dead CSS; the nav dropdown is the single switcher, and it already records the choice in localStorage for the root auto-route.
1 parent 4151837 commit ee052b3

2 files changed

Lines changed: 0 additions & 42 deletions

File tree

website/themes/moderncpp/layout/index.ejs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@
1212
</div>
1313
</div>
1414

15-
<div id="lang-switch">
16-
<% if (isEn) { %>
17-
<a class="lang-btn" href="<%- url_for("/modern-cpp/") %>" onclick="try{localStorage.setItem('mcpp-lang','zh')}catch(e){}">
18-
<span class="flag" style="content: url(/modern-cpp/assets/lang/cn.svg); display: inline-block; width: 15px; height: 15px; vertical-align: middle; margin-right: 6px; margin-bottom: 2px;"></span>中文
19-
</a>
20-
<% } else { %>
21-
<a class="lang-btn" href="<%- url_for("/modern-cpp/en/") %>" onclick="try{localStorage.setItem('mcpp-lang','en')}catch(e){}">
22-
<span class="flag" style="content: url(/modern-cpp/assets/lang/en.svg); display: inline-block; width: 15px; height: 15px; vertical-align: middle; margin-right: 6px; margin-bottom: 2px;"></span>English
23-
</a>
24-
<% } %>
25-
</div>
26-
2715
<% if (isEn) { %>
2816
<div id="hero">
2917
<div class="inner">

website/themes/moderncpp/source/modern-cpp/css/index.styl

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,6 @@ body
2222
.logo
2323
display: none
2424

25-
#lang-switch
26-
text-align: center
27-
padding: 90px 40px 0 200px
28-
a.lang-btn
29-
display: inline-block
30-
text-decoration: none
31-
background: transparent
32-
border: 1px solid rgba(126, 45, 54, 0.4)
33-
color: $theme
34-
font-size: 0.95em
35-
font-weight: 600
36-
letter-spacing: .05em
37-
padding: 6px 16px
38-
margin: 0 4px
39-
border-radius: 4px
40-
cursor: pointer
41-
transition: all .2s ease
42-
&:hover
43-
background: $theme
44-
color: #fff
45-
border-color: $theme
46-
.flag
47-
width: 15px
48-
height: 15px
49-
margin-right: 6px
50-
vertical-align: middle
51-
margin-bottom: 2px
52-
5325
#hero
5426
padding: 60px 40px 40px 200px
5527
background-color: #fff
@@ -115,8 +87,6 @@ body
11587
display: none
11688
#mobile-bar
11789
display: block
118-
#lang-switch
119-
padding: 70px 40px 0
12090
#hero
12191
padding: 20px 40px 50px
12292
.hero-logo

0 commit comments

Comments
 (0)