From 991bc2f11642ee1fcce63ac699fd681587065de2 Mon Sep 17 00:00:00 2001 From: Mivinci <1366723936@qq.com> Date: Sat, 6 Nov 2021 15:28:56 +0800 Subject: [PATCH] some styles fixes --- Makefile | 2 +- assets/js/style.js | 7 +++++-- assets/sass/atom.scss | 4 ++++ assets/sass/main.scss | 4 +++- exampleSite/config.toml | 11 +++++++---- exampleSite/content/chinese.md | 16 ++++++++++++++++ 6 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 exampleSite/content/chinese.md diff --git a/Makefile b/Makefile index 78d62e5..24c0ae5 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ themeDir=../.. .PHONY: dev, build, clean dev: - rm -r exampleSite/resources + -rm -r exampleSite/resources hugo server -D -s $(source) --themesDir $(themeDir) --disableFastRender build: diff --git a/assets/js/style.js b/assets/js/style.js index 1b1fed8..911b2fb 100644 --- a/assets/js/style.js +++ b/assets/js/style.js @@ -1,6 +1,9 @@ -// This file contains some codes to fix style of elements under `.md` +// fix style of checkboxes in posts. document.querySelectorAll('.md ul').forEach(v => { if (/
  • .+<\/li>/.test(v.innerHTML)) { v.classList.add('ul-checkbox'); } -}); \ No newline at end of file +}); + +// use custom font family +document.querySelector('body').style.setProperty('--global-font-family', '{{ .Site.Params.globalFontFamily }}'); \ No newline at end of file diff --git a/assets/sass/atom.scss b/assets/sass/atom.scss index b3ecbfa..238a3e6 100644 --- a/assets/sass/atom.scss +++ b/assets/sass/atom.scss @@ -4,6 +4,10 @@ outline: none; } +header nav a { + line-height: 1.8; +} + $unit: 0.25rem; $scales: 0, 1, 2, 3, 4, 5, 6, 7, 8, 1.5; $screens: ( diff --git a/assets/sass/main.scss b/assets/sass/main.scss index 86d2b4e..3372df3 100644 --- a/assets/sass/main.scss +++ b/assets/sass/main.scss @@ -10,6 +10,8 @@ --tag: #333; --w-mobile: 640px; + + --global-font-family: Verdana, Geneva, Tahoma, sans-serif; } html.dark { @@ -26,7 +28,7 @@ html.dark { } body { - font-family: "Helvetica Neue", Helvetica, sans-serif; + font-family: var(--global-font-family); max-width: var(--w-mobile); margin: 3rem auto 0; font-size: 16px; diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 6c28472..765d34a 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,8 +1,8 @@ baseURL = "http://h.xjj.pub" languageCode = "en-us" title = "Hi Folks" -copyright = "© Copyright notice" -paginate = 5 +copyright = "© XJJ 2021" +paginate = 6 googleAnalytics = "" disqusShortname = "hugo-minima" @@ -33,9 +33,12 @@ timeformat = "Jan 2, 2006" # switch for turning on/off lights. switch = ["🌚", "🌝"] # if true, date of posts will be displayed in the homepage. -displayDate = false +displayDate = true # if true, users can select text from your post. -selectable = false +selectable = true +# custom global font. notice: `globalFontFamily` won't be working +# on texts in some special positions. e.g. title +globalFontFamily = 'Helvatica, sans-serif' # OvO is a comment plugin written by the author of Minima. diff --git a/exampleSite/content/chinese.md b/exampleSite/content/chinese.md new file mode 100644 index 0000000..87a7326 --- /dev/null +++ b/exampleSite/content/chinese.md @@ -0,0 +1,16 @@ +--- +author: XJJ +title: 中文测试 +date: 2021-07-17T10:52:59+08:00 +description: +--- + +## 二级标题 + +这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文 + +### 三级标题 + +这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文这是测试正文 + +#### 四级标题 \ No newline at end of file