Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
LoveIt
提交
1d1cae63
L
LoveIt
项目概览
OpenDocCN
/
LoveIt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
LoveIt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1d1cae63
编写于
3月 04, 2020
作者:
D
Dillon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(i18n): add select-menu for i18n
上级
cbfc965c
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
73 addition
and
35 deletion
+73
-35
assets/css/_partial/_header.scss
assets/css/_partial/_header.scss
+22
-0
assets/css/_partial/_home/_summary.scss
assets/css/_partial/_home/_summary.scss
+5
-18
assets/css/_variables.scss
assets/css/_variables.scss
+1
-1
exampleSite/config.toml
exampleSite/config.toml
+4
-14
layouts/partials/header.html
layouts/partials/header.html
+39
-0
resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.content
...le.template.scss_40942e46c3aa444eabf479d066570690.content
+1
-1
resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.json
...style.template.scss_40942e46c3aa444eabf479d066570690.json
+1
-1
未找到文件。
assets/css/_partial/_header.scss
浏览文件 @
1d1cae63
...
...
@@ -10,6 +10,28 @@ header {
.header-title
{
font-weight
:
bold
;
}
.select-language
{
font-weight
:
$global-font-weight
;
border
:
none
;
box-shadow
:
none
;
background
:
transparent
;
background-image
:
none
;
-webkit-appearance
:
none
;
color
:
$global-font-color
;
.dark-theme
&
{
color
:
$global-font-color-dark
;
}
&
:focus
{
outline
:
none
;
}
&
:hover
{
cursor
:
pointer
;
}
}
}
#header-desktop
{
...
...
assets/css/_partial/_home/_summary.scss
浏览文件 @
1d1cae63
...
...
@@ -30,24 +30,6 @@
font-size
:
1
.6rem
;
}
.post-meta
{
a
{
color
:
$global-font-secondary-color
!
important
;
.dark-theme
&
{
color
:
$global-font-secondary-color-dark
!
important
;
}
&
:hover
{
color
:
$global-link-hover-color
!
important
;
.dark-theme
&
{
color
:
$global-link-hover-color-dark
!
important
;
}
}
}
}
.content
{
display
:
-
moz-box
;
display
:
-
webkit-box
;
...
...
@@ -59,6 +41,11 @@
overflow
:
hidden
;
text-overflow
:
ellipsis
;
overflow-wrap
:
break-word
;
color
:
$global-font-secondary-color
;
.dark-theme
&
{
color
:
$global-font-secondary-color-dark
;
}
h2
,
h3
,
...
...
assets/css/_variables.scss
浏览文件 @
1d1cae63
...
...
@@ -6,7 +6,7 @@
// Font and Line Height
$global-font-family
:
-
apple-system
,
BlinkMacSystemFont
,
PingFang
SC
,
Microsoft
Yahei
,
Segoe
UI
,
Helvetica
,
Arial
,
sans-serif
,
Segoe
UI
Emoji
!
default
;
$global-font-size
:
16px
;
$global-font-weight
:
3
00
;
$global-font-weight
:
4
00
;
$global-line-height
:
1
.5rem
;
// Color of the background
...
...
exampleSite/config.toml
浏览文件 @
1d1cae63
...
...
@@ -26,6 +26,8 @@ enableEmoji = true
languageCode
=
"en"
# website title
title
=
"LoveIt Theme"
# language name
languageName
=
"English"
# whether to include chinese/japanese/korean
hasCJKLanguage
=
false
# default amount of posts in each pages
...
...
@@ -58,13 +60,6 @@ enableEmoji = true
name
=
"About"
url
=
"/about/"
weight
=
4
[[languages.en.menu.main]]
identifier
=
"zh"
pre
=
'<i class="fas fa-language fa-fw"></i>'
name
=
""
title
=
"简体中文"
url
=
"/zh/"
weight
=
5
[languages.en.params]
# site description
description
=
"About LoveIt Theme"
...
...
@@ -232,6 +227,8 @@ enableEmoji = true
languageCode
=
"zh"
# 网站标题
title
=
"LoveIt 主题"
# 语言名称
languageName
=
"简体中文"
# 是否包括中日韩文字
hasCJKLanguage
=
true
# 默认每页列表显示的文章数目
...
...
@@ -264,13 +261,6 @@ enableEmoji = true
name
=
"关于"
url
=
"/about/"
weight
=
4
[[languages.zh.menu.main]]
identifier
=
"en"
pre
=
'<i class="fas fa-language fa-fw"></i>'
name
=
""
title
=
"English"
url
=
"../"
weight
=
5
[languages.zh.params]
# 网站描述
description
=
"关于 LoveIt 主题"
...
...
layouts/partials/header.html
浏览文件 @
1d1cae63
...
...
@@ -12,6 +12,26 @@
{{- .Pre | safeHTML }}{{ .Name -}}
</a>
{{- end -}}
{{- if .Site.IsMultiLingual -}}
|
<span
class=
"menu-item"
>
<i
class=
"fas fa-language fa-fw"
></i>
<select
class=
"select-language"
onchange=
"location = this.value;"
>
{{- range .Page.AllTranslations -}}
{{- $translation := . -}}
{{- range $.Site.Languages -}}
{{- if eq $translation.Lang .Lang -}}
{{- if eq $.Page.Lang .Lang -}}
<option
value=
"{{ $translation.Permalink }}"
selected
>
{{ .LanguageName }}
</option>
{{- else -}}
<option
value=
"{{ $translation.Permalink }}"
>
{{ .LanguageName }}
</option>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
</select>
</span>
{{- end -}}
<a
href=
"javascript:void(0);"
class=
"theme-switch"
title=
"{{ T "
switchTheme
"
}}"
>
<i
class=
"fas fa-adjust fa-rotate-180 fa-fw"
></i>
</a>
...
...
@@ -39,6 +59,25 @@
{{- .Pre | safeHTML }}{{ .Name -}}
</a>
{{- end -}}
{{- if .Site.IsMultiLingual -}}
<span
class=
"menu-item"
>
<i
class=
"fas fa-language fa-fw"
></i>
<select
class=
"select-language"
onchange=
"location = this.value;"
>
{{- range .Site.Home.AllTranslations -}}
{{- $translation := . -}}
{{- range $.Site.Languages -}}
{{- if eq $translation.Lang .Lang -}}
{{- if eq $.Page.Lang .Lang -}}
<option
value=
"{{ $translation.Permalink }}"
selected
>
{{ .LanguageName }}
</option>
{{- else -}}
<option
value=
"{{ $translation.Permalink }}"
>
{{ .LanguageName }}
</option>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
</select>
</span>
{{- end -}}
<a
href=
"javascript:void(0);"
class=
"theme-switch"
title=
"{{ T "
switchTheme
"
}}"
>
<i
class=
"fas fa-adjust fa-rotate-180 fa-fw"
></i>
</a>
...
...
resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.content
浏览文件 @
1d1cae63
此差异已折叠。
点击以展开。
resources/_gen/assets/scss/css/style.template.scss_40942e46c3aa444eabf479d066570690.json
浏览文件 @
1d1cae63
{
"Target"
:
"css/style.min.8d8ebcf734d4e8e32cab589f8df6e5bad5775d4d25d0cf2b66c6c5476831f18d.css"
,
"MediaType"
:
"text/css"
,
"Data"
:{
"Integrity"
:
"sha256-jY689zTU6OMsq1ifjfblutV3XU0l0M8rZsbFR2gx8Y0="
}}
\ No newline at end of file
{
"Target"
:
"css/style.min.52eef027334e2f9819adcad242e7298beefaf3f468d9085be0327f795ae0e4e5.css"
,
"MediaType"
:
"text/css"
,
"Data"
:{
"Integrity"
:
"sha256-Uu7wJzNOL5gZrcrSQucpi+768/Ro2Qhb4DJ/eVrg5OU="
}}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录