Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Apr 29, 2020
2 parents b85225b + f6f7d91 commit 2ea59f0
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 48 deletions.
6 changes: 6 additions & 0 deletions assets/css/_mixin/_compatibility.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@
word-wrap: $value;
overflow-wrap: $value;
}

@mixin line-break($value) {
-webkit-line-break: $value;
-ms-line-break: $value;
line-break: $value;
}
2 changes: 1 addition & 1 deletion assets/css/_mixin/_link.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@mixin link($light, $dark) {
a {
a, a::before, a::after {
color: if($light, $global-link-color, $single-link-color);

[theme=dark] & {
Expand Down
18 changes: 3 additions & 15 deletions assets/css/_mixin/_summary.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,17 @@
h5,
h6 {
line-height: 2;

&::before {
content: "|";
margin-right: .3125rem;
color: $global-link-color;

[theme=dark] & {
color: $global-link-color-dark;
}
}
}

h2 {
font-size: 1.2rem;

&::before {
content: "#";
}
}

@include link(true, true);
@include link(false, true);

b, strong {
color: $global-font-secondary-color;

[theme=dark] & {
color: $global-font-secondary-color-dark;
}
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 @@ -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
1 change: 1 addition & 0 deletions assets/css/_partial/_single/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ code {
max-width: 100%;
padding: 0 .4rem;
@include overflow-wrap(break-word);
@include line-break(anywhere);
font-size: $code-font-size;
font-family: $code-font-family;
color: $code-color;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/_partial/_single/_toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
padding-left: .8rem;
list-style: none;

a::before {
a:first-child::before {
content: "|";
font-weight: bolder;
margin-right: .5rem;
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
2 changes: 1 addition & 1 deletion exampleSite/content/about.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ math:

{{< admonition warning >}}
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!
Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

> [:(far fa-kiss-wink-heart fa-fw): 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).
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 @@ -21,7 +21,7 @@ Cet article propose un exemple de syntaxe Markdown de base qui peut être utilis

{{< admonition warning >}}
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!
Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

{{< admonition >}}
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/posts/emoji-support.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Emoji peut être activé dans un projet Hugo de plusieurs façons.

{{< admonition warning >}}
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!
Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates#inline-shortcodes).
Expand Down
16 changes: 13 additions & 3 deletions exampleSite/content/posts/theme-documentation-basics.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ Please open the code block below to view the complete sample configuration :(far
desktopMode = "fixed"
# mobile header mode ("fixed", "normal", "auto")
mobileMode = "auto"
# {{< version 0.2.0 >}} Header title config
[params.header.title]
# URL of the LOGO
logo = ""
# title name
name = ""
# 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 = ""

# Footer config
[params.footer]
Expand Down Expand Up @@ -793,6 +803,8 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s

### 4.1 Compatibility {#language-compatibility}

{{< version 0.2.0 changed >}}

| Language | Hugo Code | HTML `lang` Attribute | Theme Docs | Lunr.js Support |
|:-------------------- |:---------:|:---------------------:|:-----------------------------:|:-----------------------------:|
| English | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
Expand All @@ -802,8 +814,6 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s
| Brazilian Portuguese | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |

:(far fa-kiss-wink-heart fa-fw): **Feel free to [contribute](https://github.com/dillonzq/LoveIt/pulls)!**

### 4.2 Basic Configuration

After learning [how Hugo handle multilingual websites](https://gohugo.io/content-management/multilingual), define your languages in your [site configuration](#site-configuration).
Expand Down Expand Up @@ -931,7 +941,7 @@ Translations strings are used for common default values used in the theme. Trans

To override these values, create a new file in your local i18n folder `i18n/<languageCode>.toml` and inspire yourself from `themes/LoveIt/i18n/en.toml`.

By the way, as these translations could be used by other people, please take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
By the way, as these translations could be used by other people, please take the time to propose a translation by [:(fas fa-code-branch fa-fw): :(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!

## 5 Search

Expand Down
18 changes: 14 additions & 4 deletions exampleSite/content/posts/theme-documentation-basics.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Découvrez en quoi consiste le thème Hugo - **LoveIt** et les concepts fondamen

{{< admonition warning >}}
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!
Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

## 1 Requirements
Expand Down Expand Up @@ -245,6 +245,16 @@ Please open the code block below to view the complete sample configuration :(far
desktopMode = "fixed"
# mobile header mode ("fixed", "normal", "auto")
mobileMode = "auto"
# {{< version 0.2.0 >}} Header title config
[params.header.title]
# URL of the LOGO
logo = ""
# title name
name = ""
# 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 = ""

# Footer config
[params.footer]
Expand Down Expand Up @@ -798,6 +808,8 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s

### 4.1 Compatibility {#language-compatibility}

{{< version 0.2.0 changed >}}

| Language | Hugo Code | HTML `lang` Attribute | Theme Docs | Lunr.js Support |
|:-------------------- |:---------:|:---------------------:|:-----------------------------:|:-----------------------------:|
| English | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
Expand All @@ -807,8 +819,6 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s
| Brazilian Portuguese | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |

:(far fa-kiss-wink-heart fa-fw): **Feel free to [contribute](https://github.com/dillonzq/LoveIt/pulls)!**

### 4.2 Basic Configuration

After learning [how Hugo handle multilingual websites](https://gohugo.io/content-management/multilingual), define your languages in your [site configuration](#site-configuration).
Expand Down Expand Up @@ -936,7 +946,7 @@ Translations strings are used for common default values used in the theme. Trans

To override these values, create a new file in your local i18n folder `i18n/<languageCode>.toml` and inspire yourself from `themes/LoveIt/i18n/en.toml`.

By the way, as these translations could be used by other people, please take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
By the way, as these translations could be used by other people, please take the time to propose a translation by [:(fas fa-code-branch fa-fw): :(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!

## 5 Search

Expand Down
22 changes: 16 additions & 6 deletions exampleSite/content/posts/theme-documentation-basics.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ hugo
desktopMode = "fixed"
# 移动端导航栏模式 ("fixed", "normal", "auto")
mobileMode = "auto"
# {{< version 0.2.0 >}} 页面头部导航栏标题配置
[params.header.title]
# LOGO 的 URL
logo = ""
# 标题名称
name = ""
# 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标
pre = ""
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
post = ""

# 页面底部信息配置
[params.footer]
Expand Down Expand Up @@ -383,7 +393,7 @@ hugo
# {{< version 0.2.0 >}} 是否使用 twemoji
twemoji = false
# 是否使用 lightgallery
lightgallery = true
lightgallery = false
# {{< version 0.2.0 >}} 是否使用 ruby 扩展语法
ruby = true
# {{< version 0.2.0 >}} 是否使用 fraction 扩展语法
Expand Down Expand Up @@ -485,11 +495,11 @@ hugo
enable = false
appId = ""
appKey = ""
placeholder = "Your comment ..."
placeholder = ""
avatar = "mp"
meta= ""
pageSize = 10
lang = "en"
lang = ""
visitor = true
recordIP = true
highlight = true
Expand Down Expand Up @@ -797,6 +807,8 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac

### 4.1 兼容性 {#language-compatibility}

{{< version 0.2.0 changed >}}

| 语言 | Hugo 代码 | HTML `lang` 属性 | 主题文档 | Lunr.js 支持 |
|:---- |:----:|:----:|:----:|:----:|
| 英语 | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
Expand All @@ -806,8 +818,6 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac
| 巴西葡萄牙语 | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 意大利语 | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |

:(far fa-kiss-wink-heart fa-fw): **请自由地[贡献代码](https://github.com/dillonzq/LoveIt/pulls)!**

### 4.2 基本配置

学习了 [Hugo如何处理多语言网站](https://gohugo.io/content-management/multilingual) 之后, 请在 [站点配置](#site-configuration) 中定义你的网站语言.
Expand Down Expand Up @@ -936,7 +946,7 @@ defaultContentLanguage = "zh-cn"

要覆盖默认值, 请在你项目的 i18n 目录 `i18n/<languageCode>.toml` 中创建一个新文件,并从 `themes/LoveIt/i18n/en.toml` 中获得提示.

另外, 由于你的翻译可能会帮助到其他人, 请花点时间通过 [创建一个 PR](https://github.com/dillonzq/LoveIt/pulls) 来贡献主题翻译, 谢谢!
另外, 由于你的翻译可能会帮助到其他人, 请花点时间通过 [:(fas fa-code-branch fa-fw): 创建一个 PR](https://github.com/dillonzq/LoveIt/pulls) 来贡献主题翻译, 谢谢!

## 5 搜索

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lightgallery: true

{{< admonition warning >}}
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!
Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

Hugo uses Markdown for its simple content format. However, there are a lot of things that Markdown doesn’t support well. You could use pure HTML to expand possibilities.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Découvrez comment créer et organiser votre contenu rapidement et intuitivement

{{< admonition warning >}}
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!
Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

## 1 Contents Organization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Le thème **LoveIt** fournit plusieurs shortcodes en plus de ceux intégrés dan

{{< admonition warning >}}
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!
Welcome to take the time to propose a translation by [:(fas fa-code-branch fa-fw): making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
{{< /admonition >}}

## style
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 2ea59f0

Please sign in to comment.