Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix(header): header style and search dropdown (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq authored Apr 29, 2020
1 parent 7affd65 commit fa4c567
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 12 deletions.
11 changes: 9 additions & 2 deletions assets/css/_partial/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ header {
}

.logo {
min-height: 1.25em;
height: 1.25em;
min-height: 1.5em;
height: 1.5em;
vertical-align: text-bottom;
}

.logo, .header-title-pre {
padding-right: .25rem;
}

.header-title-post {
padding-left: .25rem;
}
}

.header-wrapper {
Expand Down
3 changes: 1 addition & 2 deletions assets/js/theme.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/theme.min.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ enableEmoji = true
[[languages.en.menu.main]]
identifier = "github"
pre = "<i class='fab fa-github fa-fw'></i>"
post = ""
name = ""
url = "https://github.com/dillonzq/LoveIt"
title = "GitHub"
Expand Down Expand Up @@ -279,6 +280,7 @@ enableEmoji = true
[[languages.zh-cn.menu.main]]
identifier = "github"
pre = "<i class='fab fa-github fa-fw'></i>"
post = ""
name = ""
url = "https://github.com/dillonzq/LoveIt"
title = "GitHub"
Expand Down Expand Up @@ -468,6 +470,7 @@ enableEmoji = true
[[languages.fr.menu.main]]
identifier = "github"
pre = "<i class='fab fa-github fa-fw'></i>"
post = ""
name = ""
url = "https://github.com/dillonzq/LoveIt"
title = "GitHub"
Expand Down Expand Up @@ -636,7 +639,7 @@ enableEmoji = true
name = "LoveIt"
# you can add extra information before the name (HTML format is supported), such as icons
# 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标
pre = "<i class='far fa-kiss-wink-heart fa-fw'></i> "
pre = "<i class='far fa-kiss-wink-heart fa-fw'></i>"
# you can add extra information after the name (HTML format is supported), such as icons
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
post = ""
Expand Down
16 changes: 14 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
{{- with .logo -}}
{{- partial "plugin/image.html" (dict "src" . "alt" $.Site.Title "class" "logo") -}}
{{- end -}}
{{- .pre | safeHTML }}{{ .name }}{{ .post | safeHTML -}}
{{- with .pre -}}
<span class="header-title-pre">{{ . | safeHTML }}</span>
{{- end -}}
{{- .name -}}
{{- with .post -}}
<span class="header-title-post">{{ . | safeHTML }}</span>
{{- end -}}
{{- else -}}
{{- .Site.Title -}}
{{- end -}}
Expand Down Expand Up @@ -79,7 +85,13 @@
{{- with .logo -}}
{{- partial "plugin/image.html" (dict "src" . "alt" $.Site.Title "class" "logo") -}}
{{- end -}}
{{- .pre | safeHTML }}{{ .name }}{{ .post | safeHTML -}}
{{- with .pre -}}
<span class="header-title-pre">{{ . | safeHTML }}</span>
{{- end -}}
{{- .name -}}
{{- with .post -}}
<span class="header-title-post">{{ . | safeHTML }}</span>
{{- end -}}
{{- else -}}
{{- .Site.Title -}}
{{- end -}}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Theme {
dropdownMenuContainer: `#search-dropdown-${classSuffix}`,
clearOnSelected: true,
cssClasses: { noPrefix: true },
// debug: true,
debug: true,
}, {
name: 'search',
source: (query, callback) => {
Expand Down

0 comments on commit fa4c567

Please sign in to comment.