From 7f3ab2ed368397d230d87f1d5f6ef4dcae1bec54 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Wed, 16 Feb 2022 21:25:24 +0800 Subject: [PATCH] :sparkles: Fea(temp)t: add pageStyle option (#62) Tip: This commit needs to be improved and to be tested. Please don't update to it! --- CHANGELOG.md | 1 + assets/css/_core/_media.scss | 7 +++---- assets/css/_page/_index.scss | 5 ++++- exampleSite/config.toml | 7 +++++++ layouts/_default/baseof.html | 3 ++- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bbbfbbad..c08a2e52a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. - :tada: Feat: add Artalk comment support ([#54](https://github.com/Lruihao/FixIt/issues/54)) - :sparkles: Style: add media style for print view ([#61](https://github.com/Lruihao/FixIt/issues/61)) +- :sparkles: Feat: add pageStyle option ([#62](https://github.com/Lruihao/FixIt/issues/62)) - :sparkles: Feat: update watermark 1.0.3-RC (fontFamily support) - :pencil2: Style: fix typo discription should be: description ([#60](https://github.com/Lruihao/FixIt/issues/60)) - :fire: Feat: remove shortcode cardlink diff --git a/assets/css/_core/_media.scss b/assets/css/_core/_media.scss index c937b0a94..04d2d53c9 100644 --- a/assets/css/_core/_media.scss +++ b/assets/css/_core/_media.scss @@ -1,12 +1,12 @@ @media only screen and (max-width: 1440px) { .page { - width: 56%; + width: 56%; // TODO - To be adjusted. } } @media only screen and (max-width: 1200px) { .page { - width: 52%; + width: 52%; // TODO - To be adjusted. } #header-desktop .header-wrapper { @@ -86,11 +86,10 @@ @page { size: A4 portrait; margin: 1.27cm; - page-break-after: auto; } .page { - width: 100%; + width: 100%!important; padding-top: 0!important; .single-title, diff --git a/assets/css/_page/_index.scss b/assets/css/_page/_index.scss index 0d69d485c..7d8001528 100644 --- a/assets/css/_page/_index.scss +++ b/assets/css/_page/_index.scss @@ -1,9 +1,12 @@ .page { position: relative; - max-width: 800px; width: 60%; margin: 0 auto; + [page-style=wide] & { + width: 70%; + } + [header-desktop] & { padding-top: $header-height; } diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8b90434c4..c6430c34c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -13,6 +13,10 @@ themesDir = "../.." # 网站标题 title = "FixIt" +# Ignore errors +# 忽略错误 +ignoreErrors = ["error-remote-getjson"] + # whether to use robots.txt # 是否使用 robots.txt enableRobotsTXT = true @@ -610,6 +614,9 @@ enableEmoji = true # whether to show the full text content in RSS # 是否在 RSS 中显示全文内容 rssFullText = false + # Page style ("normal", "wide") + # 页面样式 ("normal", "wide") + pageStyle = "wide" # Table of the contents config # 目录配置 [params.page.toc] diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 59b46e8dc..c7f922fb5 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -26,7 +26,8 @@