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

Commit

Permalink
feat(header): add Logo, pre and post config for header title (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq authored Apr 23, 2020
1 parent 919f559 commit 87fbb05
Show file tree
Hide file tree
Showing 23 changed files with 141 additions and 44 deletions.
5 changes: 5 additions & 0 deletions assets/css/_page/_archive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
text-align: right;
}

.group-title {
margin-top: 1.5rem;
margin-bottom: 1rem;
}

@import "../_partial/_archive/terms";
@import "../_partial/_archive/tags";
}
9 changes: 4 additions & 5 deletions assets/css/_page/_single.scss
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@

img {
max-width: 100%;
min-height: 1.2rem;
min-height: 1.25em;
vertical-align: text-bottom;
}

figure {
Expand Down Expand Up @@ -339,10 +340,8 @@
}
}

.version img {
min-height: 1.2rem;
height: 1.2rem;
vertical-align: text-bottom;
.version {
height: 1.25em;
}
}

Expand Down
22 changes: 13 additions & 9 deletions assets/css/_partial/_archive/_terms.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.archive-item {
margin-left: 2rem;
}

.categories-card {
margin: 0 auto;
margin-top: 3rem;
Expand All @@ -10,7 +6,6 @@
justify-content: space-between;
flex-direction: row;
flex-wrap: wrap;
padding: 0 2.5rem;
line-height: 1.6rem;

.card-item {
Expand All @@ -32,6 +27,8 @@
font-size: 1.2rem;
font-weight: bold;
display: inline-block;
margin-top: 1rem;
margin-bottom: .75rem;
}

span {
Expand All @@ -42,12 +39,19 @@
}
}

.archive-item {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
margin: .25rem 0 .25rem 1.5rem;
}

.archive-item-link {
display: inline-block;
min-width: 10%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 95%;
text-overflow: ellipsis;

&:hover {
color: $global-link-hover-color;
Expand All @@ -64,7 +68,7 @@
}

.archive-item-date {
float: right;
width: 4em;
text-align: right;
color: $global-font-secondary-color;

Expand Down
11 changes: 9 additions & 2 deletions assets/css/_partial/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ header {
.dark & {
background-color: $header-background-color-dark;
}

.logo {
min-height: 1.25em;
height: 1.25em;
vertical-align: text-bottom;
padding-right: .25rem;
}
}

.header-wrapper {
Expand Down Expand Up @@ -136,7 +143,7 @@ header {
padding: 0 1.5rem;

.header-title {
font-size: $header-title-font-size-desktop;
font-size: $header-title-font-size;
}

.menu {
Expand Down Expand Up @@ -203,7 +210,7 @@ header {
@include transition(margin-top 0.3s ease 0s);

.header-title {
font-size: $header-title-font-size-mobile;
font-size: $header-title-font-size;
max-width: 80%;
}

Expand Down
10 changes: 5 additions & 5 deletions assets/css/_partial/_single/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ code {
font-family: $code-font-family;
color: $code-color;

img, .version img {
min-height: 1.2 * $code-font-size;
height: 1.2 * $code-font-size;
img {
min-height: 1.25em;
max-height: 1.25em;
}

.dark & {
Expand All @@ -25,7 +25,7 @@ pre {

.copy-button {
font-size: $code-font-size;
line-height: 1.4 * $code-font-size;
line-height: 1.4em;
position: absolute;
top: 0;
right: 0;
Expand Down Expand Up @@ -129,7 +129,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
.highlight {
font-family: $code-font-family;
font-size: $code-font-size;
line-height: 1.4 * $code-font-size;
line-height: 1.4em;
/* Comment */ .c,
/* CommentHashbang */ .ch,
/* CommentMultiline */ .cm,
Expand Down
4 changes: 1 addition & 3 deletions assets/css/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ $header-background-color-dark: #252627 !default;

// Font style of the header title
$header-title-font-family: $global-font-family !default;

$header-title-font-size-desktop: 1.5rem !default;
$header-title-font-size-mobile: 1.5rem !default;
$header-title-font-size: 1.5rem !default;

// Position of the header
$header-position-desktop: if($header-normal-mode-desktop, static, fixed) !default;
Expand Down
31 changes: 31 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ enableEmoji = true
identifier = "posts"
# you can add extra information before the name (HTML format is supported), such as icons
pre = ""
# you can add extra information after the name (HTML format is supported), such as icons
post = ""
name = "Posts"
url = "/posts/"
# title will be shown when you hover on this menu link.
Expand All @@ -52,27 +54,31 @@ enableEmoji = true
[[languages.en.menu.main]]
identifier = "tags"
pre = ""
post = ""
name = "Tags"
url = "/tags/"
title = ""
weight = 2
[[languages.en.menu.main]]
identifier = "categories"
pre = ""
post = ""
name = "Categories"
url = "/categories/"
title = ""
weight = 3
[[languages.en.menu.main]]
identifier = "documentation"
pre = ""
post = ""
name = "Docs"
url = "/categories/documentation/"
title = ""
weight = 4
[[languages.en.menu.main]]
identifier = "about"
pre = ""
post = ""
name = "About"
url = "/about/"
title = ""
Expand Down Expand Up @@ -212,21 +218,26 @@ enableEmoji = true
[languages.zh-cn.menu]
[[languages.zh-cn.menu.main]]
identifier = "posts"
# 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标
pre = ""
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
post = ""
name = "所有文章"
url = "/posts/"
title = ""
weight = 1
[[languages.zh-cn.menu.main]]
identifier = "tags"
pre = ""
post = ""
name = "标签"
url = "/tags/"
title = ""
weight = 2
[[languages.zh-cn.menu.main]]
identifier = "categories"
pre = ""
post = ""
name = "分类"
url = "/categories/"
title = ""
Expand All @@ -241,6 +252,7 @@ enableEmoji = true
[[languages.zh-cn.menu.main]]
identifier = "about"
pre = ""
post = ""
name = "关于"
url = "/about/"
title = ""
Expand Down Expand Up @@ -381,27 +393,31 @@ enableEmoji = true
[[languages.fr.menu.main]]
identifier = "posts"
pre = ""
post = ""
name = "Postes"
url = "/posts/"
title = ""
weight = 1
[[languages.fr.menu.main]]
identifier = "tags"
pre = ""
post = ""
name = "Balises"
url = "/tags/"
title = ""
weight = 2
[[languages.fr.menu.main]]
identifier = "categories"
pre = ""
post = ""
name = "Catégories"
url = "/categories/"
title = ""
weight = 3
[[languages.fr.menu.main]]
identifier = "documentation"
pre = ""
post = ""
name = "Docs"
url = "/categories/documentation/"
title = ""
Expand Down Expand Up @@ -556,6 +572,21 @@ enableEmoji = true
# mobile header mode ("fixed", "normal", "auto")
# 移动端导航栏模式 ("fixed", "normal", "auto")
mobileMode = "auto"
# Header title config
# 页面头部导航栏标题配置
[params.header.title]
# URL of the LOGO
# LOGO 的 URL
logo = ""
# title name
# 标题名称
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> "
# you can add extra information after the name (HTML format is supported), such as icons
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
post = ""

# Footer config
# 页面底部信息配置
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/about.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ math:
[![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt)
[![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork)

[LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/) developed by [Dillon](https://dillonzq.com).
[:(far fa-kiss-wink-heart): LoveIt](https://github.com/dillonzq/LoveIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/) developed by [Dillon](https://dillonzq.com).

It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) and [KeepIt Theme](https://github.com/liuzc/LeaveIt/).

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/about.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Sorry, this article has not been completely translated into **French**.
Welcome to take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

[LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/) developed by [Dillon](https://dillonzq.com).
[:(far fa-kiss-wink-heart): LoveIt](https://github.com/dillonzq/LoveIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/) developed by [Dillon](https://dillonzq.com).

It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) and [KeepIt Theme](https://github.com/liuzc/LeaveIt/).

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/about.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ math:
[![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt)
[![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork)

[LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) 是一个由 [Dillon](https://dillonzq.com) 开发的**简洁****优雅****高效**[Hugo](https://gohugo.io/) 博客主题。
[:(far fa-kiss-wink-heart): LoveIt](https://github.com/dillonzq/LoveIt) 是一个由 [Dillon](https://dillonzq.com) 开发的**简洁****优雅****高效**[Hugo](https://gohugo.io/) 博客主题。

它的原型基于 [LeaveIt 主题](https://github.com/liuzc/LeaveIt/)[KeepIt 主题](https://github.com/liuzc/LeaveIt/)

Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/posts/basic-markdown-syntax.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ The rendered output looks like this:

### Task Lists

Task lists allow you to create a list of items with checkboxes. To create a task list, add dashes (`-`) and brackets with a space (`[ ]`) in front of task list items. To select a checkbox, add an x in between the brackets (`[x]`).
Task lists allow you to create a list of items with checkboxes. To create a task list, add dashes (`-`) and brackets with a space (`[ ]`) before task list items. To select a checkbox, add an x in between the brackets (`[x]`).

```markdown
- [x] Write the press release
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/posts/basic-markdown-syntax.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ The rendered output looks like this:

### Task Lists

Task lists allow you to create a list of items with checkboxes. To create a task list, add dashes (`-`) and brackets with a space (`[ ]`) in front of task list items. To select a checkbox, add an x in between the brackets (`[x]`).
Task lists allow you to create a list of items with checkboxes. To create a task list, add dashes (`-`) and brackets with a space (`[ ]`) before task list items. To select a checkbox, add an x in between the brackets (`[x]`).

```markdown
- [x] Write the press release
Expand Down
Loading

0 comments on commit 87fbb05

Please sign in to comment.