From 6f14bf4b4e5cfd81e728277d2f64c915079c2b27 Mon Sep 17 00:00:00 2001 From: nodejh Date: Mon, 16 Aug 2021 15:52:21 +0800 Subject: feat: ability to disable summary in home page --- exampleSite/config.yaml | 2 ++ exampleSite/content/posts/test.md | 11 +++++++++++ layouts/index.html | 4 +++- static/css/style.css | 3 ++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 53cb813..21b0bda 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -59,6 +59,8 @@ params: showPowerBy: true # To enable math typesetting , you could set `math: true` math: false + # To disable post summary in home page, you could set `disablePostSummaryInHomePage: false`, default is `false` + disablePostSummaryInHomePage: false # text in page home: '' # Default: Home diff --git a/exampleSite/content/posts/test.md b/exampleSite/content/posts/test.md index 20b6065..f82c40e 100644 --- a/exampleSite/content/posts/test.md +++ b/exampleSite/content/posts/test.md @@ -39,6 +39,17 @@ aaaa ## t3 +1. One

+ +/``` +testing +some +code +/``` + +2. Two

+3. Three

+ 超宽显示 `var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";` 超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示 `var a = "text";` ``` diff --git a/layouts/index.html b/layouts/index.html index 81c02a9..2cf1135 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -14,7 +14,9 @@
{{ $date }}
-
{{ $summary | plainify | htmlUnescape }}
+ {{ if ne .Site.Params.disablePostSummaryInHomePage true }} +
{{ $summary | plainify | htmlUnescape }}
+ {{ end }} {{ end }} diff --git a/static/css/style.css b/static/css/style.css index e197a60..b6e9040 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -281,7 +281,7 @@ nav.navigation a.button { } #list-page .item { - margin: 48px 0 0 0; + margin: 12px 0; } #list-page .title { @@ -316,6 +316,7 @@ nav.navigation a.button { margin-top: 12px; word-break: normal; overflow-wrap: anywhere; + margin-bottom: 36px; } #list-page .cover { -- cgit v1.2.3 From 6cf25f8a16b376204cb4b9ca553a10746b157999 Mon Sep 17 00:00:00 2001 From: nodejh Date: Mon, 16 Aug 2021 15:58:30 +0800 Subject: feat: feat: ability to hidden summary in home page --- README-zh_CN.md | 9 +++++++++ README.md | 9 +++++++++ exampleSite/config.yaml | 8 ++++---- layouts/index.html | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index f9ea224..824e29f 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -180,6 +180,15 @@ customJS: - 全局支持数学排版:在项目的配置文件中将 `math` 设置为 `true` - 在某页面支持数学拍版:在某页面 Front Matter 中将 `math` 设置为 `true` +### 3.5 在首页隐藏文章摘要 + +如果要在首页隐藏文章摘要,你可以将 `hiddenPostSummaryInHomePage` 设置为 `true`,默认是 `false`。 + +例如: + +```yaml +hiddenPostSummaryInHomePage: true +``` ## License diff --git a/README.md b/README.md index 74b47e9..7ce417d 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,15 @@ Mathematical notation is enabled by [KaTeX](https://katex.org/). - To enable KaTex globally set the parameter `math` to `true` in project’s configuration - To enable KaTex on a per page basis include the parameter `math` to `true` in content files +### 3.5 Hidden Post Summary in Home Page + +To hidden post summary in home page, you could set `hiddenPostSummaryInHomePage` to `true`, default is `false`. + +For example: + +```yaml +hiddenPostSummaryInHomePage: true +``` ## License diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 21b0bda..b5caf30 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -53,14 +53,14 @@ params: enableComments: true # To enable comments, you may need to set `googleAnalytics` enableGoogleAnalytics: true - # To enable table of content, you could set `showToc: true` + # To enable table of content, you could set `showToc: true`, default is `false` showToc: true # To hidden powerBy message in the page footer, you could set: `showPowerBy: false`, default is `true` showPowerBy: true - # To enable math typesetting , you could set `math: true` + # To enable math typesetting , you could set `math: true`, default is `false` math: false - # To disable post summary in home page, you could set `disablePostSummaryInHomePage: false`, default is `false` - disablePostSummaryInHomePage: false + # To hidden post summary in home page, you could set `hiddenPostSummaryInHomePage: true`, default is `false` + hiddenPostSummaryInHomePage: false # text in page home: '' # Default: Home diff --git a/layouts/index.html b/layouts/index.html index 2cf1135..2db56a3 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -14,7 +14,7 @@
{{ $date }}
- {{ if ne .Site.Params.disablePostSummaryInHomePage true }} + {{ if ne .Site.Params.hiddenPostSummaryInHomePage true }}
{{ $summary | plainify | htmlUnescape }}
{{ end }} -- cgit v1.2.3