Skip to content

Commit

Permalink
中英文自动添加空白
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Lord committed Oct 22, 2022
1 parent df366b2 commit 752d65e
Show file tree
Hide file tree
Showing 8 changed files with 588 additions and 3 deletions.
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ author:
url : https://github.com/Young-Lord
avatar : https://avatars.githubusercontent.com/Young-Lord # path or url of avatar image (square)
bio : ""
email : [email protected]
email : [email protected] # 下面 sidebar 那里还有一个要改
github : Young-Lord


Expand Down Expand Up @@ -170,6 +170,7 @@ defaults:
show_edit_on_github: true
show_subscribe: false
pageview: true
pan_gu_zhi_bai: ture # 中英文自动添加空白


## => Plugins
Expand Down
1 change: 1 addition & 0 deletions _data/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ default:
license: false
pageview: false
search: default
pan_gu_zhi_bai: true

sources:
bootcdn:
Expand Down
10 changes: 10 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
{%- else -%}
<header class="header" {%- if include.background -%} style="background: {{ include.background }};" {%- endif -%}>
{%- endif -%}

{%- include snippets/assign.html
target=site.data.variables.default.page.pan_gu_zhi_bai
source0=layout.pan_gu_zhi_bai source1=page.pan_gu_zhi_bai -%}
{%- assign _pan_gu_zhi_bai = __return -%}
{%- if _pan_gu_zhi_bai -%}
<div>
<script src="/assets/js/text_autospace_include.js"></script>
</div>
{%- endif -%}
<div class="main">
<div class="header__title">
<div class="header__brand">
Expand Down
2 changes: 1 addition & 1 deletion _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
---
<!DOCTYPE html>
{%- include snippets/get-lang.html -%}
<html lang="{{ __return }}">
<html lang="{{ __return }}" class="han-la">
<head>
{%- include analytics.html -%}
{%- include head.html -%}
Expand Down
1 change: 1 addition & 0 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: article
title: 关于&友链
key: page-about
id: page-about
pan_gu_zhi_bai: false
---

## 碎碎念
Expand Down
23 changes: 22 additions & 1 deletion assets/css/younglord.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
/*哈哈,多半要出事*/

/*https://github.com/mastermay/text-autospace.js
中英文间自动添加空白*/
html.han-la hanla:after {
content: " ";
display: inline;
font-family: Arial;
font-size: 0.89em;
}

html.han-la code hanla,
html.han-la pre hanla,
html.han-la kbd hanla,
html.han-la samp hanla {
display: none;
}

html.han-la ol > hanla,
html.han-la ul > hanla {
display: none;
}

/*复制的,rss图标显示*/
.author-links>ul>li>.rss-button {
-webkit-transition: all 0.2s ease-in-out;
Expand Down Expand Up @@ -116,4 +137,4 @@ h1,h2,h3,h4,h5,h6 {

.sidebar {
font-family: "Source Sans Pro", "Hiragino Sans GB", "Microsoft Yahei", SimSun, Helvetica, Arial, Sans-serif, monospace;
}
}
Loading

0 comments on commit 752d65e

Please sign in to comment.